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