Merge pull request #1113 from deepak-srivastava/reportsapi
[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>
6a488035
TO
34 </field>
35 <foreignKey>
36 <name>group_id</name>
37 <table>civicrm_group</table>
38 <key>id</key>
39 <add>1.1</add>
40 <onDelete>CASCADE</onDelete>
41 </foreignKey>
42 <field>
43 <name>contact_id</name>
44 <type>int unsigned</type>
45 <title>Contact ID</title>
46 <required>true</required>
47 <comment>FK to civicrm_contact</comment>
48 <add>1.1</add>
49 </field>
50 <foreignKey>
51 <name>contact_id</name>
52 <table>civicrm_contact</table>
53 <key>id</key>
54 <add>1.1</add>
55 <onDelete>CASCADE</onDelete>
56 </foreignKey>
57 <field>
58 <name>status</name>
59 <type>enum</type>
60 <title>Group Contact Status</title>
61 <values>Added, Removed, Pending</values>
62 <comment>status of contact relative to membership in group</comment>
63 <add>1.1</add>
64 </field>
65 <field>
66 <name>location_id</name>
67 <type>int unsigned</type>
68 <title>Group Contact Location</title>
69 <comment>Optional location to associate with this membership</comment>
70 <add>1.1</add>
71 </field>
72 <foreignKey>
73 <name>location_id</name>
74 <table>civicrm_loc_block</table>
75 <key>id</key>
76 <add>1.1</add>
77 <onDelete>SET NULL</onDelete>
78 </foreignKey>
79 <field>
80 <name>email_id</name>
81 <type>int unsigned</type>
82 <title>Group Contact Email</title>
83 <comment>Optional email to associate with this membership</comment>
84 <add>1.1</add>
85 </field>
86 <foreignKey>
87 <name>email_id</name>
88 <table>civicrm_email</table>
89 <key>id</key>
90 <add>1.1</add>
91 </foreignKey>
92 <index>
93 <name>UI_contact_group</name>
94 <fieldName>contact_id</fieldName>
95 <fieldName>group_id</fieldName>
96 <unique>true</unique>
97 <add>1.6</add>
98 </index>
99</table>