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