Merge remote-tracking branch 'upstream/4.4' into 4.4-master-2014-07-14-13-42-39
[civicrm-core.git] / xml / schema / Batch / EntityBatch.xml
1 <?xml version="1.0" encoding="iso-8859-1" ?>
2
3 <table>
4 <base>CRM/Batch</base>
5 <class>EntityBatch</class>
6 <name>civicrm_entity_batch</name>
7 <comment>Batch entities (Contributions, Participants, Contacts) to a batch.</comment>
8 <field>
9 <name>id</name>
10 <type>int unsigned</type>
11 <required>true</required>
12 <comment>primary key</comment>
13 <add>3.3</add>
14 </field>
15 <primaryKey>
16 <name>id</name>
17 <autoincrement>true</autoincrement>
18 </primaryKey>
19 <field>
20 <name>entity_table</name>
21 <type>varchar</type>
22 <length>64</length>
23 <comment>physical tablename for entity being joined to file, e.g. civicrm_contact</comment>
24 <add>3.3</add>
25 </field>
26 <field>
27 <name>entity_id</name>
28 <type>int unsigned</type>
29 <required>true</required>
30 <comment>FK to entity table specified in entity_table column.</comment>
31 <add>3.3</add>
32 </field>
33 <dynamicForeignKey>
34 <idColumn>entity_id</idColumn>
35 <typeColumn>entity_table</typeColumn>
36 <add>3.3</add>
37 </dynamicForeignKey>
38 <index>
39 <name>index_entity</name>
40 <fieldName>entity_table</fieldName>
41 <fieldName>entity_id</fieldName>
42 <add>3.3</add>
43 </index>
44 <field>
45 <name>batch_id</name>
46 <type>int unsigned</type>
47 <required>true</required>
48 <comment>FK to civicrm_batch</comment>
49 <add>3.3</add>
50 </field>
51 <foreignKey>
52 <name>batch_id</name>
53 <table>civicrm_batch</table>
54 <key>id</key>
55 <add>3.3</add>
56 <onDelete>CASCADE</onDelete>
57 </foreignKey>
58 <index>
59 <name>UI_batch_entity</name>
60 <fieldName>batch_id</fieldName>
61 <fieldName>entity_id</fieldName>
62 <fieldName>entity_table</fieldName>
63 <unique>true</unique>
64 <add>3.3</add>
65 </index>
66 </table>