Merge pull request #6981 from eileenmcnaughton/CRM-17411
[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 <title>EntityBatch ID</title>
11 <type>int unsigned</type>
12 <required>true</required>
13 <comment>primary key</comment>
14 <add>3.3</add>
15 </field>
16 <primaryKey>
17 <name>id</name>
18 <autoincrement>true</autoincrement>
19 </primaryKey>
20 <field>
21 <name>entity_table</name>
22 <title>EntityBatch Table</title>
23 <type>varchar</type>
24 <length>64</length>
25 <comment>physical tablename for entity being joined to file, e.g. civicrm_contact</comment>
26 <add>3.3</add>
27 </field>
28 <field>
29 <name>entity_id</name>
30 <title>Entity ID</title>
31 <type>int unsigned</type>
32 <required>true</required>
33 <comment>FK to entity table specified in entity_table column.</comment>
34 <add>3.3</add>
35 </field>
36 <dynamicForeignKey>
37 <idColumn>entity_id</idColumn>
38 <typeColumn>entity_table</typeColumn>
39 <add>3.3</add>
40 </dynamicForeignKey>
41 <index>
42 <name>index_entity</name>
43 <fieldName>entity_table</fieldName>
44 <fieldName>entity_id</fieldName>
45 <add>3.3</add>
46 </index>
47 <field>
48 <name>batch_id</name>
49 <title>Batch ID</title>
50 <type>int unsigned</type>
51 <required>true</required>
52 <comment>FK to civicrm_batch</comment>
53 <add>3.3</add>
54 </field>
55 <foreignKey>
56 <name>batch_id</name>
57 <table>civicrm_batch</table>
58 <key>id</key>
59 <add>3.3</add>
60 <onDelete>CASCADE</onDelete>
61 </foreignKey>
62 <index>
63 <name>UI_batch_entity</name>
64 <fieldName>batch_id</fieldName>
65 <fieldName>entity_id</fieldName>
66 <fieldName>entity_table</fieldName>
67 <unique>true</unique>
68 <add>3.3</add>
69 </index>
70 </table>