Merge pull request #18606 from eileenmcnaughton/create
[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 <icon>fa-users</icon>
11 <field>
12 <name>id</name>
13 <type>int unsigned</type>
14 <title>Group ID</title>
15 <required>true</required>
16 <comment>Group ID</comment>
17 <add>1.1</add>
18 </field>
19 <primaryKey>
20 <name>id</name>
21 <autoincrement>true</autoincrement>
22 </primaryKey>
23 <field>
24 <name>name</name>
25 <type>varchar</type>
26 <title>Group Name</title>
27 <length>64</length>
28 <comment>Internal name of Group.</comment>
29 <add>1.1</add>
30 </field>
31 <field>
32 <name>title</name>
33 <type>varchar</type>
34 <title>Group Title</title>
35 <length>255</length>
36 <localizable>true</localizable>
37 <required>true</required>
38 <comment>Name of Group.</comment>
39 <add>1.1</add>
40 <html>
41 <type>Text</type>
42 </html>
43 </field>
44 <field>
45 <name>description</name>
46 <type>text</type>
47 <title>Group Description</title>
48 <html>
49 <type>TextArea</type>
50 <rows>2</rows>
51 <cols>60</cols>
52 </html>
53 <comment>Optional verbose description of the group.</comment>
54 <add>1.1</add>
55 </field>
56 <field>
57 <name>source</name>
58 <type>varchar</type>
59 <title>Group Source</title>
60 <length>64</length>
61 <comment>Module or process which created this group.</comment>
62 <add>1.1</add>
63 </field>
64 <field>
65 <name>saved_search_id</name>
66 <type>int unsigned</type>
67 <title>Saved Search ID</title>
68 <comment>FK to saved search table.</comment>
69 <add>1.1</add>
70 </field>
71 <foreignKey>
72 <name>saved_search_id</name>
73 <table>civicrm_saved_search</table>
74 <key>id</key>
75 <add>1.1</add>
76 <onDelete>SET NULL</onDelete>
77 </foreignKey>
78 <field>
79 <name>is_active</name>
80 <type>boolean</type>
81 <title>Group Enabled</title>
82 <comment>Is this entry active?</comment>
83 <add>1.1</add>
84 </field>
85 <field>
86 <name>visibility</name>
87 <type>varchar</type>
88 <length>24</length>
89 <title>Group Visibility Setting</title>
90 <default>'User and User Admin Only'</default>
91 <comment>In what context(s) is this field visible.</comment>
92 <pseudoconstant>
93 <callback>CRM_Core_SelectValues::groupVisibility</callback>
94 </pseudoconstant>
95 <add>1.2</add>
96 <html>
97 <type>Select</type>
98 </html>
99 </field>
100 <field>
101 <name>where_clause</name>
102 <type>text</type>
103 <title>Group Where Clause</title>
104 <comment>the sql where clause if a saved search acl</comment>
105 <add>1.6</add>
106 </field>
107 <field>
108 <name>select_tables</name>
109 <type>text</type>
110 <title>Tables For Select Clause</title>
111 <comment>the tables to be included in a select data</comment>
112 <serialize>PHP</serialize>
113 <add>1.6</add>
114 </field>
115 <field>
116 <name>where_tables</name>
117 <type>text</type>
118 <title>Tables For Where Clause</title>
119 <comment>the tables to be included in the count statement</comment>
120 <serialize>PHP</serialize>
121 <add>1.6</add>
122 </field>
123 <field>
124 <name>group_type</name>
125 <type>varchar</type>
126 <title>Group Type</title>
127 <length>128</length>
128 <comment>FK to group type</comment>
129 <pseudoconstant>
130 <optionGroupName>group_type</optionGroupName>
131 </pseudoconstant>
132 <serialize>SEPARATOR_BOOKEND</serialize>
133 <add>1.9</add>
134 </field>
135 <field>
136 <name>cache_date</name>
137 <type>timestamp</type>
138 <title>Group Cache Date</title>
139 <required>false</required>
140 <comment>Date when we created the cache for a smart group</comment>
141 <add>2.1</add>
142 </field>
143 <field>
144 <name>refresh_date</name>
145 <type>timestamp</type>
146 <title>Next Group Refresh Time</title>
147 <required>false</required>
148 <comment>Date and time when we need to refresh the cache next.</comment>
149 <add>4.3</add>
150 </field>
151 <field>
152 <name>parents</name>
153 <type>text</type>
154 <title>Group Parents</title>
155 <comment>IDs of the parent(s)</comment>
156 <add>2.1</add>
157 <serialize>COMMA</serialize>
158 <pseudoconstant>
159 <callback>CRM_Core_PseudoConstant::allGroup</callback>
160 </pseudoconstant>
161 </field>
162 <field>
163 <name>children</name>
164 <type>text</type>
165 <title>Group Children</title>
166 <comment>IDs of the child(ren)</comment>
167 <add>2.1</add>
168 </field>
169 <field>
170 <name>is_hidden</name>
171 <type>boolean</type>
172 <title>Group is Hidden</title>
173 <default>0</default>
174 <comment>Is this group hidden?</comment>
175 <add>2.2</add>
176 </field>
177 <field>
178 <name>is_reserved</name>
179 <type>boolean</type>
180 <title>Group is Reserved</title>
181 <default>0</default>
182 <add>4.2</add>
183 </field>
184 <index>
185 <name>index_group_type</name>
186 <fieldName>group_type</fieldName>
187 <add>1.9</add>
188 </index>
189 <index>
190 <name>UI_title</name>
191 <fieldName>title</fieldName>
192 <unique>true</unique>
193 <add>2.1</add>
194 </index>
195 <index>
196 <name>UI_name</name>
197 <fieldName>name</fieldName>
198 <unique>true</unique>
199 <add>2.1</add>
200 </index>
201 <field>
202 <name>created_id</name>
203 <type>int unsigned</type>
204 <title>Group Created By</title>
205 <comment>FK to contact table.</comment>
206 <add>4.3</add>
207 </field>
208 <foreignKey>
209 <name>created_id</name>
210 <table>civicrm_contact</table>
211 <key>id</key>
212 <add>4.3</add>
213 <onDelete>SET NULL</onDelete>
214 </foreignKey>
215 <field>
216 <name>modified_id</name>
217 <type>int unsigned</type>
218 <title>Group Modified By</title>
219 <comment>FK to contact table.</comment>
220 <add>4.5</add>
221 </field>
222 <foreignKey>
223 <name>modified_id</name>
224 <table>civicrm_contact</table>
225 <key>id</key>
226 <add>4.5</add>
227 <onDelete>SET NULL</onDelete>
228 </foreignKey>
229 <field>
230 <name>frontend_title</name>
231 <type>varchar</type>
232 <title>Public Group Title</title>
233 <length>255</length>
234 <localizable>true</localizable>
235 <comment>Alternative public title for this Group.</comment>
236 <default>NULL</default>
237 <add>5.31</add>
238 <html>
239 <type>Text</type>
240 </html>
241 </field>
242 <field>
243 <name>frontend_description</name>
244 <type>text</type>
245 <title>Public Group Description</title>
246 <html>
247 <type>TextArea</type>
248 <rows>2</rows>
249 <cols>60</cols>
250 </html>
251 <comment>Alternative public description of the group.</comment>
252 <localizable>true</localizable>
253 <default>NULL</default>
254 <add>5.31</add>
255 </field>
256 </table>