Commit | Line | Data |
---|---|---|
6a488035 TO |
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> | |
8f069c03 EM |
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> | |
6a488035 TO |
16 | </field> |
17 | <primaryKey> | |
8f069c03 EM |
18 | <name>id</name> |
19 | <autoincrement>true</autoincrement> | |
6a488035 TO |
20 | </primaryKey> |
21 | <field> | |
8f069c03 EM |
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> | |
6a488035 TO |
28 | </field> |
29 | <foreignKey> | |
8f069c03 EM |
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> | |
6a488035 TO |
36 | </foreignKey> |
37 | <field> | |
8f069c03 EM |
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> | |
583bd2a5 SL |
43 | <pseudoconstant> |
44 | <optionGroupName>tag_used_for</optionGroupName> | |
45 | </pseudoconstant> | |
8f069c03 | 46 | <add>3.2</add> |
6a488035 TO |
47 | </field> |
48 | <field> | |
8f069c03 EM |
49 | <name>entity_id</name> |
50 | <type>int unsigned</type> | |
51 | <title>Entity ID</title> | |
52 | <required>true</required> | |
53 | <comment>FK to entity table specified in entity_table column.</comment> | |
54 | <add>3.2</add> | |
6a488035 | 55 | </field> |
71e5aa5c | 56 | <dynamicForeignKey> |
8f069c03 EM |
57 | <idColumn>entity_id</idColumn> |
58 | <typeColumn>entity_table</typeColumn> | |
59 | <add>3.2</add> | |
71e5aa5c | 60 | </dynamicForeignKey> |
6a488035 | 61 | <index> |
8f069c03 EM |
62 | <name>index_entity</name> |
63 | <fieldName>entity_table</fieldName> | |
64 | <fieldName>entity_id</fieldName> | |
65 | <add>3.2</add> | |
66 | <drop>3.4</drop> | |
3c7d2158 | 67 | </index> |
6a488035 | 68 | <field> |
8f069c03 EM |
69 | <name>tag_id</name> |
70 | <type>int unsigned</type> | |
2ee21eaa | 71 | <title>Tag</title> |
8f069c03 EM |
72 | <required>true</required> |
73 | <comment>FK to civicrm_tag</comment> | |
74 | <add>1.1</add> | |
75 | <pseudoconstant> | |
76 | <table>civicrm_tag</table> | |
77 | <keyColumn>id</keyColumn> | |
78 | <labelColumn>name</labelColumn> | |
79 | </pseudoconstant> | |
80 | <html> | |
81 | <type>Select</type> | |
82 | </html> | |
6a488035 TO |
83 | </field> |
84 | <foreignKey> | |
8f069c03 EM |
85 | <name>tag_id</name> |
86 | <table>civicrm_tag</table> | |
87 | <key>id</key> | |
88 | <add>1.1</add> | |
89 | <onDelete>CASCADE</onDelete> | |
6a488035 TO |
90 | </foreignKey> |
91 | <index> | |
92 | <name>UI_entity_id_entity_table_tag_id</name> | |
93 | <fieldName>entity_id</fieldName> | |
94 | <fieldName>entity_table</fieldName> | |
95 | <fieldName>tag_id</fieldName> | |
96 | <unique>true</unique> | |
97 | <add>3.4</add> | |
98 | </index> | |
99 | </table> |