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