Merge pull request #18327 from civicrm/5.29
[civicrm-core.git] / xml / schema / Core / CustomField.xml
1 <?xml version="1.0" encoding="iso-8859-1" ?>
2
3 <table>
4 <base>CRM/Core</base>
5 <class>CustomField</class>
6 <name>civicrm_custom_field</name>
7 <comment>Stores info about an extended (custom) property (data and form field info).</comment>
8 <add>1.1</add>
9 <log>true</log>
10 <field>
11 <name>id</name>
12 <type>int unsigned</type>
13 <title>Custom Field ID</title>
14 <required>true</required>
15 <comment>Unique Custom Field 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>custom_group_id</name>
24 <type>int unsigned</type>
25 <title>Custom Group</title>
26 <required>true</required>
27 <comment>FK to civicrm_custom_group.</comment>
28 <add>1.1</add>
29 <pseudoconstant>
30 <table>civicrm_custom_group</table>
31 <keyColumn>id</keyColumn>
32 <labelColumn>title</labelColumn>
33 </pseudoconstant>
34 <html>
35 <type>Select</type>
36 </html>
37 </field>
38 <foreignKey>
39 <name>custom_group_id</name>
40 <table>civicrm_custom_group</table>
41 <key>id</key>
42 <add>1.1</add>
43 <onDelete>CASCADE</onDelete>
44 </foreignKey>
45 <field>
46 <name>name</name>
47 <type>varchar</type>
48 <title>Custom Field Name</title>
49 <length>64</length>
50 <comment>Variable name/programmatic handle for this group.</comment>
51 <add>3.3</add>
52 </field>
53 <field>
54 <name>label</name>
55 <type>varchar</type>
56 <title>Custom Field Label</title>
57 <length>255</length>
58 <required>true</required>
59 <localizable>true</localizable>
60 <comment>Text for form field label (also friendly name for administering this custom property).</comment>
61 <add>1.1</add>
62 </field>
63 <field>
64 <name>data_type</name>
65 <type>varchar</type>
66 <title>Custom Field Data Type</title>
67 <length>16</length>
68 <required>true</required>
69 <comment>Controls location of data storage in extended_data table.</comment>
70 <pseudoconstant>
71 <callback>CRM_Core_BAO_CustomField::dataType</callback>
72 </pseudoconstant>
73 <add>1.1</add>
74 <html>
75 <type>Select</type>
76 </html>
77 </field>
78 <field>
79 <name>html_type</name>
80 <type>varchar</type>
81 <title>Custom Field HTML Type</title>
82 <length>32</length>
83 <required>true</required>
84 <comment>HTML types plus several built-in extended types.</comment>
85 <pseudoconstant>
86 <callback>CRM_Core_SelectValues::customHtmlType</callback>
87 </pseudoconstant>
88 <add>1.1</add>
89 </field>
90 <field>
91 <name>default_value</name>
92 <type>varchar</type>
93 <title>Custom Field Default</title>
94 <length>255</length>
95 <comment>Use form_options.is_default for field_types which use options.</comment>
96 <add>1.1</add>
97 </field>
98 <field>
99 <name>is_required</name>
100 <title>Custom Field Is Required?</title>
101 <type>boolean</type>
102 <comment>Is a value required for this property.</comment>
103 <default>0</default>
104 <add>1.1</add>
105 </field>
106 <field>
107 <name>is_searchable</name>
108 <title>Allow Searching on Field?</title>
109 <type>boolean</type>
110 <comment>Is this property searchable.</comment>
111 <default>0</default>
112 <add>1.1</add>
113 </field>
114 <field>
115 <name>is_search_range</name>
116 <type>boolean</type>
117 <title>Search as a Range</title>
118 <comment>Is this property range searchable.</comment>
119 <add>1.4</add>
120 <default>0</default>
121 </field>
122 <field>
123 <name>weight</name>
124 <type>int</type>
125 <title>Order</title>
126 <required>true</required>
127 <default>1</default>
128 <comment>Controls field display order within an extended property group.</comment>
129 <add>1.1</add>
130 </field>
131 <field>
132 <name>help_pre</name>
133 <type>text</type>
134 <title>Custom Field Pre Text</title>
135 <localizable>true</localizable>
136 <comment>Description and/or help text to display before this field.</comment>
137 <add>1.1</add>
138 </field>
139 <field>
140 <name>help_post</name>
141 <type>text</type>
142 <title>Custom Field Post Text</title>
143 <localizable>true</localizable>
144 <comment>Description and/or help text to display after this field.</comment>
145 <add>1.1</add>
146 </field>
147 <field>
148 <name>mask</name>
149 <type>varchar</type>
150 <title>Custom Field Formatting</title>
151 <length>64</length>
152 <comment>Optional format instructions for specific field types, like date types.</comment>
153 <add>1.1</add>
154 </field>
155 <field>
156 <name>attributes</name>
157 <type>varchar</type>
158 <title>Custom Field Attributes</title>
159 <length>255</length>
160 <comment>Store collection of type-appropriate attributes, e.g. textarea needs rows/cols attributes</comment>
161 <add>1.1</add>
162 </field>
163 <field>
164 <name>javascript</name>
165 <type>varchar</type>
166 <title>Custom Field Javascript</title>
167 <length>255</length>
168 <comment>Optional scripting attributes for field.</comment>
169 <add>1.1</add>
170 </field>
171 <field>
172 <name>is_active</name>
173 <type>boolean</type>
174 <title>Custom Field Is Active?</title>
175 <comment>Is this property active?</comment>
176 <default>1</default>
177 <add>1.1</add>
178 </field>
179 <field>
180 <name>is_view</name>
181 <type>boolean</type>
182 <title>Field is Viewable</title>
183 <default>0</default>
184 <comment>Is this property set by PHP Code? A code field is viewable but not editable</comment>
185 <add>1.1</add>
186 </field>
187 <field>
188 <name>options_per_line</name>
189 <type>int unsigned</type>
190 <title>Field Options Per Line</title>
191 <comment>number of options per line for checkbox and radio</comment>
192 </field>
193 <field>
194 <name>text_length</name>
195 <type>int unsigned</type>
196 <title>Field Length</title>
197 <comment>field length if alphanumeric</comment>
198 <add>2.2</add>
199 </field>
200 <field>
201 <name>start_date_years</name>
202 <type>int</type>
203 <title>Field Start Date</title>
204 <comment>Date may be up to start_date_years years prior to the current date.</comment>
205 <add>1.4</add>
206 </field>
207 <field>
208 <name>end_date_years</name>
209 <type>int</type>
210 <title>Field End Date</title>
211 <comment>Date may be up to end_date_years years after the current date.</comment>
212 <add>1.4</add>
213 </field>
214 <field>
215 <name>date_format</name>
216 <type>varchar</type>
217 <title>Field Data Format</title>
218 <length>64</length>
219 <comment>date format for custom date</comment>
220 <add>3.1</add>
221 <pseudoconstant>
222 <callback>CRM_Core_SelectValues::getDatePluginInputFormats</callback>
223 </pseudoconstant>
224 </field>
225 <field>
226 <name>time_format</name>
227 <type>int unsigned</type>
228 <title>Field Time Format</title>
229 <comment>time format for custom date</comment>
230 <add>3.1</add>
231 <pseudoconstant>
232 <callback>CRM_Core_SelectValues::getTimeFormats</callback>
233 </pseudoconstant>
234 </field>
235 <field>
236 <name>note_columns</name>
237 <type>int unsigned</type>
238 <title>Field Note Columns</title>
239 <comment>Number of columns in Note Field</comment>
240 <add>1.4</add>
241 </field>
242 <field>
243 <name>note_rows</name>
244 <type>int unsigned</type>
245 <title>Field Note Rows</title>
246 <comment>Number of rows in Note Field</comment>
247 <add>1.4</add>
248 </field>
249 <field>
250 <name>column_name</name>
251 <type>varchar</type>
252 <title>Field Column Name</title>
253 <length>255</length>
254 <comment>Name of the column that holds the values for this field.</comment>
255 <add>2.0</add>
256 </field>
257 <field>
258 <name>option_group_id</name>
259 <type>int unsigned</type>
260 <title>Field Option Group</title>
261 <comment>For elements with options, the option group id that is used</comment>
262 <add>1.4</add>
263 <pseudoconstant>
264 <table>civicrm_option_group</table>
265 <keyColumn>id</keyColumn>
266 <labelColumn>title</labelColumn>
267 </pseudoconstant>
268 </field>
269 <foreignKey>
270 <name>option_group_id</name>
271 <table>civicrm_option_group</table>
272 <key>id</key>
273 <add>5.6</add>
274 <onDelete>SET NULL</onDelete>
275 </foreignKey>
276 <field>
277 <name>serialize</name>
278 <type>int unsigned</type>
279 <title>Serialize</title>
280 <length>255</length>
281 <comment>Serialization method - a non-null value indicates a multi-valued field.</comment>
282 <pseudoconstant>
283 <callback>CRM_Core_SelectValues::fieldSerialization</callback>
284 </pseudoconstant>
285 <add>5.27</add>
286 </field>
287 <field>
288 <name>filter</name>
289 <type>varchar</type>
290 <title>Field Filter</title>
291 <length>255</length>
292 <comment>Stores Contact Get API params contact reference custom fields. May be used for other filters in the future.</comment>
293 <add>4.1</add>
294 </field>
295 <field>
296 <name>in_selector</name>
297 <type>boolean</type>
298 <title>Field Display</title>
299 <default>0</default>
300 <comment>Should the multi-record custom field values be displayed in tab table listing</comment>
301 <add>4.5</add>
302 </field>
303 <index>
304 <name>UI_label_custom_group_id</name>
305 <fieldName>label</fieldName>
306 <fieldName>custom_group_id</fieldName>
307 <unique>true</unique>
308 <add>1.1</add>
309 </index>
310 <index>
311 <name>UI_name_custom_group_id</name>
312 <fieldName>name</fieldName>
313 <fieldName>custom_group_id</fieldName>
314 <unique>true</unique>
315 <add>4.3</add>
316 </index>
317 </table>