Import from SVN (r45945, r596)
[civicrm-core.git] / xml / schema / Core / EntityTag.xml
1 <?xml version="1.0" encoding="iso-8859-1" ?>
2
3 <table>
4 <base>CRM/Core</base>
5 <class>EntityTag</class>
6 <name>civicrm_entity_tag</name>
7 <comment>Tag entities (Contacts, Groups, Actions) to categories.</comment>
8 <log>true</log>
9 <field>
10 <name>id</name>
11 <type>int unsigned</type>
12 <title>Entity Tag ID</title>
13 <required>true</required>
14 <comment>primary key</comment>
15 <add>1.1</add>
16 </field>
17 <primaryKey>
18 <name>id</name>
19 <autoincrement>true</autoincrement>
20 </primaryKey>
21 <field>
22 <name>contact_id</name>
23 <type>int unsigned</type>
24 <required>true</required>
25 <comment>FK to contact table.</comment>
26 <add>2.0</add>
27 <drop>3.2</drop>
28 </field>
29 <foreignKey>
30 <name>contact_id</name>
31 <table>civicrm_contact</table>
32 <key>id</key>
33 <add>2.0</add>
34 <drop>3.2</drop>
35 <onDelete>CASCADE</onDelete>
36 </foreignKey>
37 <field>
38 <name>entity_table</name>
39 <type>varchar</type>
40 <title>Entity Table</title>
41 <length>64</length>
42 <comment>physical tablename for entity being joined to file, e.g. civicrm_contact</comment>
43 <add>3.2</add>
44 </field>
45 <field>
46 <name>entity_id</name>
47 <type>int unsigned</type>
48 <title>Entity ID</title>
49 <required>true</required>
50 <comment>FK to entity table specified in entity_table column.</comment>
51 <add>3.2</add>
52 </field>
53 <index>
54 <name>index_entity</name>
55 <fieldName>entity_table</fieldName>
56 <fieldName>entity_id</fieldName>
57 <add>3.2</add>
58 <drop>3.4</drop>
59 </index>
60 <field>
61 <name>tag_id</name>
62 <type>int unsigned</type>
63 <title>Tag ID</title>
64 <required>true</required>
65 <comment>FK to civicrm_tag</comment>
66 <add>1.1</add>
67 </field>
68 <foreignKey>
69 <name>tag_id</name>
70 <table>civicrm_tag</table>
71 <key>id</key>
72 <add>1.1</add>
73 <onDelete>CASCADE</onDelete>
74 </foreignKey>
75 <index>
76 <name>UI_entity_id_entity_table_tag_id</name>
77 <fieldName>entity_id</fieldName>
78 <fieldName>entity_table</fieldName>
79 <fieldName>tag_id</fieldName>
80 <unique>true</unique>
81 <add>3.4</add>
82 </index>
83 </table>