Merge pull request #19920 from totten/master-upgrade-token
[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 <html>
18 <type>Number</type>
19 </html>
20 <add>4.3</add>
21 </field>
22 <primaryKey>
23 <name>id</name>
24 <autoincrement>true</autoincrement>
25 </primaryKey>
26 <field>
27 <name>entity_table</name>
28 <title>Entity Table</title>
29 <type>varchar</type>
30 <length>64</length>
31 <required>true</required>
32 <import>true</import>
33 <add>4.3</add>
34 <comment>Links to an entity_table like civicrm_financial_type</comment>
35 </field>
36 <field>
37 <name>entity_id</name>
38 <title>Entity ID</title>
39 <type>int unsigned</type>
40 <required>true</required>
41 <add>4.3</add>
42 <comment>Links to an id in the entity_table, such as vid in civicrm_financial_type</comment>
43 </field>
44 <dynamicForeignKey>
45 <idColumn>entity_id</idColumn>
46 <typeColumn>entity_table</typeColumn>
47 <add>4.3</add>
48 </dynamicForeignKey>
49 <field>
50 <name>account_relationship</name>
51 <title>Account Relationship</title>
52 <type>int unsigned</type>
53 <required>true</required>
54 <add>4.3</add>
55 <comment>FK to a new civicrm_option_value (account_relationship)</comment>
56 <pseudoconstant>
57 <optionGroupName>account_relationship</optionGroupName>
58 </pseudoconstant>
59 <html>
60 <type>Select</type>
61 </html>
62 </field>
63 <field>
64 <name>financial_account_id</name>
65 <type>int unsigned</type>
66 <title>Financial Account ID</title>
67 <required>true</required>
68 <add>4.3</add>
69 <comment>FK to the financial_account_id</comment>
70 <pseudoconstant>
71 <table>civicrm_financial_account</table>
72 <keyColumn>id</keyColumn>
73 <labelColumn>name</labelColumn>
74 </pseudoconstant>
75 <html>
76 <type>Select</type>
77 <label>Financial Account</label>
78 </html>
79 </field>
80 <foreignKey>
81 <name>financial_account_id</name>
82 <table>civicrm_financial_account</table>
83 <key>id</key>
84 <add>4.3</add>
85 <onDelete>RESTRICT</onDelete>
86 </foreignKey>
87 <index>
88 <name>index_entity_id_entity_table_account_relationship</name>
89 <fieldName>entity_id</fieldName>
90 <fieldName>entity_table</fieldName>
91 <fieldName>account_relationship</fieldName>
92 <unique>true</unique>
93 <add>4.7</add>
94 </index>
95 </table>