Merge pull request #19531 from ahed-compucorp/master
[civicrm-core.git] / xml / schema / Financial / EntityFinancialTrxn.xml
1 <?xml version="1.0" encoding="iso-8859-1" ?>
2
3 <table>
4 <base>CRM/Financial</base>
5 <class>EntityFinancialTrxn</class>
6 <name>civicrm_entity_financial_trxn</name>
7 <add>3.2</add>
8 <component>CiviContribute</component>
9 <field>
10 <name>id</name>
11 <title>Entity Financial Transaction ID</title>
12 <type>int unsigned</type>
13 <required>true</required>
14 <comment>ID</comment>
15 <html>
16 <type>Number</type>
17 </html>
18 <add>3.2</add>
19 </field>
20 <primaryKey>
21 <name>id</name>
22 <autoincrement>true</autoincrement>
23 </primaryKey>
24 <field>
25 <name>entity_table</name>
26 <title>Entity Table</title>
27 <type>varchar</type>
28 <length>64</length>
29 <required>true</required>
30 <import>true</import>
31 <add>3.2</add>
32 <comment>May contain civicrm_financial_item, civicrm_contribution, civicrm_financial_trxn, civicrm_grant, etc</comment>
33 </field>
34 <field>
35 <name>entity_id</name>
36 <title>Entity ID</title>
37 <type>int unsigned</type>
38 <required>true</required>
39 <add>3.2</add>
40 </field>
41 <dynamicForeignKey>
42 <idColumn>entity_id</idColumn>
43 <typeColumn>entity_table</typeColumn>
44 <add>3.2</add>
45 </dynamicForeignKey>
46 <field>
47 <name>financial_trxn_id</name>
48 <title>Financial Transaction ID</title>
49 <type>int unsigned</type>
50 <html>
51 <label>Financial Transaction</label>
52 </html>
53 <add>3.2</add>
54 </field>
55 <foreignKey>
56 <name>financial_trxn_id</name>
57 <table>civicrm_financial_trxn</table>
58 <key>id</key>
59 <add>3.2</add>
60 <onDelete>SET NULL</onDelete>
61 </foreignKey>
62 <field>
63 <name>amount</name>
64 <title>Amount</title>
65 <type>decimal</type>
66 <required>true</required>
67 <import>true</import>
68 <headerPattern>/amount/i</headerPattern>
69 <dataPattern>/^\d+(\.\d{2})?$/</dataPattern>
70 <comment>allocated amount of transaction to this entity</comment>
71 <add>3.2</add>
72 </field>
73 <index>
74 <name>UI_entity_financial_trxn_entity_table</name>
75 <fieldName>entity_table</fieldName>
76 <add>4.3</add>
77 </index>
78 <index>
79 <name>UI_entity_financial_trxn_entity_id</name>
80 <fieldName>entity_id</fieldName>
81 <add>4.3</add>
82 </index>
83 </table>
84