Merge pull request #2120 from pratik-joshi/CRM-13857
[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 <required>true</required>
14 <comment>Unique Custom Field ID</comment>
15 <add>1.1</add>
16 </field>
17 <primaryKey>
18 <name>id</name>
19 <autoincrement>true</autoincrement>
20 </primaryKey>
21 <field>
22 <name>custom_group_id</name>
23 <type>int unsigned</type>
24 <required>true</required>
25 <comment>FK to civicrm_custom_group.</comment>
26 <add>1.1</add>
27 <pseudoconstant>
28 <table>civicrm_custom_group</table>
29 <keyColumn>id</keyColumn>
30 <labelColumn>title</labelColumn>
31 </pseudoconstant>
32 </field>
33 <foreignKey>
34 <name>custom_group_id</name>
35 <table>civicrm_custom_group</table>
36 <key>id</key>
37 <add>1.1</add>
38 <onDelete>CASCADE</onDelete>
39 </foreignKey>
40 <field>
41 <name>name</name>
42 <type>varchar</type>
43 <length>64</length>
44 <comment>Variable name/programmatic handle for this group.</comment>
45 <add>3.3</add>
46 </field>
47 <field>
48 <name>label</name>
49 <type>varchar</type>
50 <length>255</length>
51 <required>true</required>
52 <localizable>true</localizable>
53 <comment>Text for form field label (also friendly name for administering this custom property).</comment>
54 <add>1.1</add>
55 </field>
56 <field>
57 <name>data_type</name>
58 <type>enum</type>
59 <values>String, Int, Float, Money, Memo, Date, Boolean, StateProvince, Country, File, Link, ContactReference</values>
60 <required>true</required>
61 <comment>Controls location of data storage in extended_data table.</comment>
62 <add>1.1</add>
63 </field>
64 <field>
65 <name>html_type</name>
66 <type>enum</type>
67 <values>Text, TextArea, Select, Multi-Select, AdvMulti-Select, Radio, CheckBox, Select Date, Select State/Province, Select Country, Multi-Select Country, Multi-Select State/Province, File, Link, RichTextEditor, Autocomplete-Select</values>
68 <required>true</required>
69 <comment>HTML types plus several built-in extended types.</comment>
70 <add>1.1</add>
71 </field>
72 <field>
73 <name>default_value</name>
74 <type>varchar</type>
75 <length>255</length>
76 <comment>Use form_options.is_default for field_types which use options.</comment>
77 <add>1.1</add>
78 </field>
79 <field>
80 <name>is_required</name>
81 <type>boolean</type>
82 <comment>Is a value required for this property.</comment>
83 <add>1.1</add>
84 </field>
85 <field>
86 <name>is_searchable</name>
87 <type>boolean</type>
88 <comment>Is this property searchable.</comment>
89 <add>1.1</add>
90 </field>
91 <field>
92 <name>is_search_range</name>
93 <type>boolean</type>
94 <comment>Is this property range searchable.</comment>
95 <add>1.4</add>
96 <default>0</default>
97 </field>
98 <field>
99 <name>weight</name>
100 <type>int</type>
101 <required>true</required>
102 <default>1</default>
103 <comment>Controls field display order within an extended property group.</comment>
104 <add>1.1</add>
105 </field>
106 <field>
107 <name>help_pre</name>
108 <type>text</type>
109 <localizable>true</localizable>
110 <comment>Description and/or help text to display before this field.</comment>
111 <add>1.1</add>
112 </field>
113 <field>
114 <name>help_post</name>
115 <type>text</type>
116 <localizable>true</localizable>
117 <comment>Description and/or help text to display after this field.</comment>
118 <add>1.1</add>
119 </field>
120 <field>
121 <name>mask</name>
122 <type>varchar</type>
123 <length>64</length>
124 <comment>Optional format instructions for specific field types, like date types.</comment>
125 <add>1.1</add>
126 </field>
127 <field>
128 <name>attributes</name>
129 <type>varchar</type>
130 <length>255</length>
131 <comment>Store collection of type-appropriate attributes, e.g. textarea needs rows/cols attributes</comment>
132 <add>1.1</add>
133 </field>
134 <field>
135 <name>javascript</name>
136 <type>varchar</type>
137 <length>255</length>
138 <comment>Optional scripting attributes for field.</comment>
139 <add>1.1</add>
140 </field>
141 <field>
142 <name>is_active</name>
143 <type>boolean</type>
144 <comment>Is this property active?</comment>
145 <add>1.1</add>
146 </field>
147 <field>
148 <name>is_view</name>
149 <type>boolean</type>
150 <comment>Is this property set by PHP Code? A code field is viewable but not editable</comment>
151 <add>1.1</add>
152 </field>
153 <field>
154 <name>options_per_line</name>
155 <type>int unsigned</type>
156 <comment>number of options per line for checkbox and radio</comment>
157 </field>
158 <field>
159 <name>text_length</name>
160 <type>int unsigned</type>
161 <comment>field length if alphanumeric</comment>
162 <add>2.2</add>
163 </field>
164 <field>
165 <name>start_date_years</name>
166 <type>int</type>
167 <comment>Date may be up to start_date_years years prior to the current date.</comment>
168 <add>1.4</add>
169 </field>
170 <field>
171 <name>end_date_years</name>
172 <type>int</type>
173 <comment>Date may be up to end_date_years years after the current date.</comment>
174 <add>1.4</add>
175 </field>
176 <field>
177 <name>date_parts</name>
178 <type>varchar</type>
179 <length>255</length>
180 <comment>which date part included in display </comment>
181 <add>1.4</add>
182 <drop>3.1</drop>
183 </field>
184 <field>
185 <name>date_format</name>
186 <type>varchar</type>
187 <length>64</length>
188 <comment>date format for custom date</comment>
189 <add>3.1</add>
190 </field>
191 <field>
192 <name>time_format</name>
193 <type>int unsigned</type>
194 <comment>time format for custom date</comment>
195 <add>3.1</add>
196 </field>
197 <field>
198 <name>note_columns</name>
199 <type>int unsigned</type>
200 <comment> Number of columns in Note Field </comment>
201 <add>1.4</add>
202 </field>
203 <field>
204 <name>note_rows</name>
205 <type>int unsigned</type>
206 <comment> Number of rows in Note Field </comment>
207 <add>1.4</add>
208 </field>
209 <field>
210 <name>column_name</name>
211 <type>varchar</type>
212 <length>255</length>
213 <comment>Name of the column that holds the values for this field.</comment>
214 <add>2.0</add>
215 </field>
216 <field>
217 <name>option_group_id</name>
218 <type>int unsigned</type>
219 <comment>For elements with options, the option group id that is used</comment>
220 <add>1.4</add>
221 </field>
222 <field>
223 <name>filter</name>
224 <type>varchar</type>
225 <length>255</length>
226 <comment>Stores Contact Get API params contact reference custom fields. May be used for other filters in the future.</comment>
227 <add>4.1</add>
228 </field>
229 <index>
230 <name>UI_label_custom_group_id</name>
231 <fieldName>label</fieldName>
232 <fieldName>custom_group_id</fieldName>
233 <unique>true</unique>
234 <add>1.1</add>
235 </index>
236 <index>
237 <name>UI_name_custom_group_id</name>
238 <fieldName>name</fieldName>
239 <fieldName>custom_group_id</fieldName>
240 <unique>true</unique>
241 <add>4.3</add>
242 </index>
243 </table>