Merge pull request #18939 from colemanw/serializeFix
[civicrm-core.git] / xml / schema / Financial / EntityFinancialAccount.xml
1 <?xml version="1.0" encoding="iso-8859-1" ?>
2
3 <table>
4 <base>CRM/Financial</base>
5 <class>EntityFinancialAccount</class>
6 <name>civicrm_entity_financial_account</name>
7 <add>4.3</add>
8 <comment>Map between an entity and a financial account, where there is a specific relationship between the financial account and the entity, e.g. Income Account for or AR Account for</comment>
9 <log>true</log>
10 <component>CiviContribute</component>
11 <field>
12 <name>id</name>
13 <title>Entity Financial Account ID</title>
14 <type>int unsigned</type>
15 <required>true</required>
16 <comment>ID</comment>
17 <add>4.3</add>
18 </field>
19 <primaryKey>
20 <name>id</name>
21 <autoincrement>true</autoincrement>
22 </primaryKey>
23 <field>
24 <name>entity_table</name>
25 <title>Entity Table</title>
26 <type>varchar</type>
27 <length>64</length>
28 <required>true</required>
29 <import>true</import>
30 <add>4.3</add>
31 <comment>Links to an entity_table like civicrm_financial_type</comment>
32 </field>
33 <field>
34 <name>entity_id</name>
35 <title>Entity ID</title>
36 <type>int unsigned</type>
37 <required>true</required>
38 <add>4.3</add>
39 <comment>Links to an id in the entity_table, such as vid in civicrm_financial_type</comment>
40 </field>
41 <dynamicForeignKey>
42 <idColumn>entity_id</idColumn>
43 <typeColumn>entity_table</typeColumn>
44 <add>4.3</add>
45 </dynamicForeignKey>
46 <field>
47 <name>account_relationship</name>
48 <title>Account Relationship</title>
49 <type>int unsigned</type>
50 <required>true</required>
51 <add>4.3</add>
52 <comment>FK to a new civicrm_option_value (account_relationship)</comment>
53 <pseudoconstant>
54 <optionGroupName>account_relationship</optionGroupName>
55 </pseudoconstant>
56 <html>
57 <type>Select</type>
58 </html>
59 </field>
60 <field>
61 <name>financial_account_id</name>
62 <type>int unsigned</type>
63 <title>Financial Account</title>
64 <required>true</required>
65 <add>4.3</add>
66 <comment>FK to the financial_account_id</comment>
67 <pseudoconstant>
68 <table>civicrm_financial_account</table>
69 <keyColumn>id</keyColumn>
70 <labelColumn>name</labelColumn>
71 </pseudoconstant>
72 <html>
73 <type>Select</type>
74 </html>
75 </field>
76 <foreignKey>
77 <name>financial_account_id</name>
78 <table>civicrm_financial_account</table>
79 <key>id</key>
80 <add>4.3</add>
81 <onDelete>RESTRICT</onDelete>
82 </foreignKey>
83 <index>
84 <name>index_entity_id_entity_table_account_relationship</name>
85 <fieldName>entity_id</fieldName>
86 <fieldName>entity_table</fieldName>
87 <fieldName>account_relationship</fieldName>
88 <unique>true</unique>
89 <add>4.7</add>
90 </index>
91 </table>