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