Merge pull request #11456 from jitendrapurohit/CRM-21598
[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 <serialize>PHP</serialize>
108 <add>1.6</add>
109 </field>
110 <field>
111 <name>where_tables</name>
112 <type>text</type>
113 <title>Tables For Where Clause</title>
114 <comment>the tables to be included in the count statement</comment>
115 <serialize>PHP</serialize>
116 <add>1.6</add>
117 </field>
118 <field>
119 <name>group_type</name>
120 <type>varchar</type>
121 <title>Group Type</title>
122 <length>128</length>
123 <comment>FK to group type</comment>
124 <pseudoconstant>
125 <optionGroupName>group_type</optionGroupName>
126 </pseudoconstant>
127 <serialize>SEPARATOR_BOOKEND</serialize>
128 <add>1.9</add>
129 </field>
130 <field>
131 <name>cache_date</name>
132 <type>timestamp</type>
133 <title>Group Cache Date</title>
134 <required>false</required>
135 <comment>Date when we created the cache for a smart group</comment>
136 <add>2.1</add>
137 </field>
138 <field>
139 <name>refresh_date</name>
140 <type>timestamp</type>
141 <title>Next Group Refresh Time</title>
142 <required>false</required>
143 <comment>Date and time when we need to refresh the cache next.</comment>
144 <add>4.3</add>
145 </field>
146 <field>
147 <name>parents</name>
148 <type>text</type>
149 <title>Group Parents</title>
150 <comment>IDs of the parent(s)</comment>
151 <add>2.1</add>
152 <serialize>COMMA</serialize>
153 <pseudoconstant>
154 <callback>CRM_Core_PseudoConstant::allGroup</callback>
155 </pseudoconstant>
156 </field>
157 <field>
158 <name>children</name>
159 <type>text</type>
160 <title>Group Children</title>
161 <comment>IDs of the child(ren)</comment>
162 <add>2.1</add>
163 </field>
164 <field>
165 <name>is_hidden</name>
166 <type>boolean</type>
167 <title>Group is Hidden</title>
168 <default>0</default>
169 <comment>Is this group hidden?</comment>
170 <add>2.2</add>
171 </field>
172 <field>
173 <name>is_reserved</name>
174 <type>boolean</type>
175 <title>Group is Reserved</title>
176 <default>0</default>
177 <add>4.2</add>
178 </field>
179 <index>
180 <name>index_group_type</name>
181 <fieldName>group_type</fieldName>
182 <add>1.9</add>
183 </index>
184 <index>
185 <name>UI_title</name>
186 <fieldName>title</fieldName>
187 <unique>true</unique>
188 <add>2.1</add>
189 </index>
190 <index>
191 <name>UI_name</name>
192 <fieldName>name</fieldName>
193 <unique>true</unique>
194 <add>2.1</add>
195 </index>
196 <field>
197 <name>created_id</name>
198 <type>int unsigned</type>
199 <title>Group Created By</title>
200 <comment>FK to contact table.</comment>
201 <add>4.3</add>
202 </field>
203 <foreignKey>
204 <name>created_id</name>
205 <table>civicrm_contact</table>
206 <key>id</key>
207 <add>4.3</add>
208 <onDelete>SET NULL</onDelete>
209 </foreignKey>
210 <field>
211 <name>modified_id</name>
212 <type>int unsigned</type>
213 <title>Group Modified By</title>
214 <comment>FK to contact table.</comment>
215 <add>4.5</add>
216 </field>
217 <foreignKey>
218 <name>modified_id</name>
219 <table>civicrm_contact</table>
220 <key>id</key>
221 <add>4.5</add>
222 <onDelete>SET NULL</onDelete>
223 </foreignKey>
224 </table>