CRM-13497 - getting there on main tables
[civicrm-core.git] / xml / schema / Contact / GroupContact.xml
CommitLineData
6a488035
TO
1<?xml version="1.0" encoding="iso-8859-1" ?>
2
3<table>
4 <base>CRM/Contact</base>
5 <class>GroupContact</class>
6 <name>civicrm_group_contact</name>
7 <comment>Join table sets membership for 'static' groups. Also used to store 'opt-out' entries for 'query' type groups (status = 'OUT')</comment>
8 <add>1.1</add>
9 <log>true</log>
10 <field>
11 <name>id</name>
12 <type>int unsigned</type>
13 <title>Group Contact ID</title>
14 <required>true</required>
15 <comment>primary key</comment>
16 <add>1.1</add>
17 </field>
18 <primaryKey>
19 <name>id</name>
20 <autoincrement>true</autoincrement>
21 </primaryKey>
22 <field>
29494eef
AS
23 <name>group_id</name>
24 <type>int unsigned</type>
25 <title>Group ID</title>
26 <required>true</required>
27 <comment>FK to civicrm_group</comment>
28 <add>1.1</add>
29 <pseudoconstant>
30 <table>civicrm_group</table>
31 <keyColumn>id</keyColumn>
32 <labelColumn>title</labelColumn>
33 </pseudoconstant>
614d72ec 34 <html>
35 <type>Select></type>
36 </html>
6a488035
TO
37 </field>
38 <foreignKey>
39 <name>group_id</name>
40 <table>civicrm_group</table>
41 <key>id</key>
42 <add>1.1</add>
43 <onDelete>CASCADE</onDelete>
44 </foreignKey>
45 <field>
46 <name>contact_id</name>
47 <type>int unsigned</type>
48 <title>Contact ID</title>
49 <required>true</required>
50 <comment>FK to civicrm_contact</comment>
51 <add>1.1</add>
52 </field>
53 <foreignKey>
54 <name>contact_id</name>
55 <table>civicrm_contact</table>
56 <key>id</key>
57 <add>1.1</add>
58 <onDelete>CASCADE</onDelete>
59 </foreignKey>
60 <field>
61 <name>status</name>
62 <type>enum</type>
63 <title>Group Contact Status</title>
64 <values>Added, Removed, Pending</values>
65 <comment>status of contact relative to membership in group</comment>
66 <add>1.1</add>
614d72ec 67 <html>
68 <type>Select</type>
69 </html>
6a488035
TO
70 </field>
71 <field>
72 <name>location_id</name>
73 <type>int unsigned</type>
74 <title>Group Contact Location</title>
75 <comment>Optional location to associate with this membership</comment>
76 <add>1.1</add>
77 </field>
78 <foreignKey>
79 <name>location_id</name>
80 <table>civicrm_loc_block</table>
81 <key>id</key>
82 <add>1.1</add>
83 <onDelete>SET NULL</onDelete>
84 </foreignKey>
85 <field>
86 <name>email_id</name>
87 <type>int unsigned</type>
88 <title>Group Contact Email</title>
89 <comment>Optional email to associate with this membership</comment>
90 <add>1.1</add>
91 </field>
92 <foreignKey>
93 <name>email_id</name>
94 <table>civicrm_email</table>
95 <key>id</key>
96 <add>1.1</add>
97 </foreignKey>
98 <index>
99 <name>UI_contact_group</name>
100 <fieldName>contact_id</fieldName>
101 <fieldName>group_id</fieldName>
102 <unique>true</unique>
103 <add>1.6</add>
104 </index>
105</table>