Merge pull request #8328 from mlutfy/master-crm18524
[civicrm-core.git] / xml / schema / Contact / Group.xml
1 <?xml version="1.0" encoding="iso-8859-1" ?>
2
3 <table>
4 <base>CRM/Contact</base>
5 <class>Group</class>
6 <name>civicrm_group</name>
7 <comment>Provide grouping of related contacts</comment>
8 <add>1.1</add>
9 <log>true</log>
10 <field>
11 <name>id</name>
12 <type>int unsigned</type>
13 <title>Group ID</title>
14 <required>true</required>
15 <comment>Group ID</comment>
16 <add>1.1</add>
17 </field>
18 <primaryKey>
19 <name>id</name>
20 <autoincrement>true</autoincrement>
21 </primaryKey>
22 <field>
23 <name>name</name>
24 <type>varchar</type>
25 <title>Group Name</title>
26 <length>64</length>
27 <comment>Internal name of Group.</comment>
28 <add>1.1</add>
29 </field>
30 <field>
31 <name>title</name>
32 <type>varchar</type>
33 <title>Group Title</title>
34 <length>64</length>
35 <localizable>true</localizable>
36 <comment>Name of Group.</comment>
37 <add>1.1</add>
38 </field>
39 <field>
40 <name>description</name>
41 <type>text</type>
42 <title>Group Description</title>
43 <html>
44 <type>TextArea</type>
45 <rows>2</rows>
46 <cols>60</cols>
47 </html>
48 <comment>Optional verbose description of the group.</comment>
49 <add>1.1</add>
50 </field>
51 <field>
52 <name>source</name>
53 <type>varchar</type>
54 <title>Group Source</title>
55 <length>64</length>
56 <comment>Module or process which created this group.</comment>
57 <add>1.1</add>
58 </field>
59 <field>
60 <name>saved_search_id</name>
61 <type>int unsigned</type>
62 <title>Saved Search ID</title>
63 <comment>FK to saved search table.</comment>
64 <add>1.1</add>
65 </field>
66 <foreignKey>
67 <name>saved_search_id</name>
68 <table>civicrm_saved_search</table>
69 <key>id</key>
70 <add>1.1</add>
71 <onDelete>SET NULL</onDelete>
72 </foreignKey>
73 <field>
74 <name>is_active</name>
75 <type>boolean</type>
76 <title>Group Enabled</title>
77 <comment>Is this entry active?</comment>
78 <add>1.1</add>
79 </field>
80 <field>
81 <name>visibility</name>
82 <type>varchar</type>
83 <length>24</length>
84 <title>Group Visibility Setting</title>
85 <default>'User and User Admin Only'</default>
86 <comment>In what context(s) is this field visible.</comment>
87 <pseudoconstant>
88 <callback>CRM_Core_SelectValues::groupVisibility</callback>
89 </pseudoconstant>
90 <add>1.2</add>
91 <html>
92 <type>Select</type>
93 </html>
94 </field>
95 <field>
96 <name>where_clause</name>
97 <type>text</type>
98 <title>Group Where Clause</title>
99 <comment>the sql where clause if a saved search acl</comment>
100 <add>1.6</add>
101 </field>
102 <field>
103 <name>select_tables</name>
104 <type>text</type>
105 <title>Tables For Select Clause</title>
106 <comment>the tables to be included in a select data</comment>
107 <add>1.6</add>
108 </field>
109 <field>
110 <name>where_tables</name>
111 <type>text</type>
112 <title>Tables For Where Clause</title>
113 <comment>the tables to be included in the count statement</comment>
114 <add>1.6</add>
115 </field>
116 <field>
117 <name>group_type</name>
118 <type>varchar</type>
119 <title>Group Type</title>
120 <length>128</length>
121 <comment>FK to group type</comment>
122 <add>1.9</add>
123 </field>
124 <field>
125 <name>cache_date</name>
126 <type>timestamp</type>
127 <title>Group Cache Date</title>
128 <required>false</required>
129 <comment>Date when we created the cache for a smart group</comment>
130 <add>2.1</add>
131 </field>
132 <field>
133 <name>refresh_date</name>
134 <type>timestamp</type>
135 <title>Next Group Refresh Time</title>
136 <required>false</required>
137 <comment>Date and time when we need to refresh the cache next.</comment>
138 <add>4.3</add>
139 </field>
140 <field>
141 <name>parents</name>
142 <type>text</type>
143 <title>Group Parents</title>
144 <comment>IDs of the parent(s)</comment>
145 <add>2.1</add>
146 </field>
147 <field>
148 <name>children</name>
149 <type>text</type>
150 <title>Group Children</title>
151 <comment>IDs of the child(ren)</comment>
152 <add>2.1</add>
153 </field>
154 <field>
155 <name>is_hidden</name>
156 <type>boolean</type>
157 <title>Group is Hidden</title>
158 <default>0</default>
159 <comment>Is this group hidden?</comment>
160 <add>2.2</add>
161 </field>
162 <field>
163 <name>is_reserved</name>
164 <type>boolean</type>
165 <title>Group is Reserved</title>
166 <default>0</default>
167 <add>4.2</add>
168 </field>
169 <index>
170 <name>index_group_type</name>
171 <fieldName>group_type</fieldName>
172 <add>1.9</add>
173 </index>
174 <index>
175 <name>UI_title</name>
176 <fieldName>title</fieldName>
177 <unique>true</unique>
178 <add>2.1</add>
179 </index>
180 <index>
181 <name>UI_name</name>
182 <fieldName>name</fieldName>
183 <unique>true</unique>
184 <add>2.1</add>
185 </index>
186 <field>
187 <name>created_id</name>
188 <type>int unsigned</type>
189 <title>Group Created By</title>
190 <comment>FK to contact table.</comment>
191 <add>4.3</add>
192 </field>
193 <foreignKey>
194 <name>created_id</name>
195 <table>civicrm_contact</table>
196 <key>id</key>
197 <add>4.3</add>
198 <onDelete>SET NULL</onDelete>
199 </foreignKey>
200 <field>
201 <name>modified_id</name>
202 <type>int unsigned</type>
203 <title>Group Modified By</title>
204 <comment>FK to contact table.</comment>
205 <add>4.5</add>
206 </field>
207 <foreignKey>
208 <name>modified_id</name>
209 <table>civicrm_contact</table>
210 <key>id</key>
211 <add>4.5</add>
212 <onDelete>SET NULL</onDelete>
213 </foreignKey>
214 </table>