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