Merge pull request #21944 from masetto/unit_plural
[civicrm-core.git] / xml / schema / Core / OptionValue.xml
1 <?xml version="1.0" encoding="iso-8859-1" ?>
2
3 <table>
4 <base>CRM/Core</base>
5 <class>OptionValue</class>
6 <name>civicrm_option_value</name>
7 <add>1.5</add>
8 <log>true</log>
9 <field>
10 <name>id</name>
11 <title>Option Value ID</title>
12 <type>int unsigned</type>
13 <required>true</required>
14 <comment>Option ID</comment>
15 <add>1.5</add>
16 </field>
17 <primaryKey>
18 <name>id</name>
19 <autoincrement>true</autoincrement>
20 </primaryKey>
21 <field>
22 <name>option_group_id</name>
23 <title>Option Group ID</title>
24 <type>int unsigned</type>
25 <required>true</required>
26 <comment>Group which this option belongs to.</comment>
27 <add>1.5</add>
28 <pseudoconstant>
29 <table>civicrm_option_group</table>
30 <keyColumn>id</keyColumn>
31 <nameColumn>name</nameColumn>
32 <labelColumn>title</labelColumn>
33 </pseudoconstant>
34 <html>
35 <type>Select</type>
36 <label>Option Group</label>
37 </html>
38 </field>
39 <foreignKey>
40 <name>option_group_id</name>
41 <table>civicrm_option_group</table>
42 <key>id</key>
43 <add>1.5</add>
44 <onDelete>CASCADE</onDelete>
45 </foreignKey>
46 <field>
47 <name>label</name>
48 <title>Option Label</title>
49 <type>varchar</type>
50 <required>true</required>
51 <length>512</length>
52 <localizable>true</localizable>
53 <comment>Option string as displayed to users - e.g. the label in an HTML OPTION tag.</comment>
54 <add>1.5</add>
55 </field>
56 <field>
57 <name>value</name>
58 <title>Option Value</title>
59 <type>varchar</type>
60 <length>512</length>
61 <required>true</required>
62 <comment>The actual value stored (as a foreign key) in the data record. Functions which need lookup option_value.title should use civicrm_option_value.option_group_id plus civicrm_option_value.value as the key.</comment>
63 <add>1.5</add>
64 <change>3.3</change>
65 </field>
66 <field>
67 <name>name</name>
68 <title>Option Name</title>
69 <type>varchar</type>
70 <length>255</length>
71 <import>true</import>
72 <comment>Stores a fixed (non-translated) name for this option value. Lookup functions should use the name as the key for the option value row.</comment>
73 <add>1.5</add>
74 </field>
75 <field>
76 <name>grouping</name>
77 <title>Option Grouping Name</title>
78 <type>varchar</type>
79 <length>255</length>
80 <comment>Use to sort and/or set display properties for sub-set(s) of options within an option group. EXAMPLE: Use for college_interest field, to differentiate partners from non-partners.</comment>
81 <add>1.5</add>
82 </field>
83 <field>
84 <name>filter</name>
85 <type>int unsigned</type>
86 <default>0</default>
87 <comment>Bitwise logic can be used to create subsets of options within an option_group for different uses.</comment>
88 <html>
89 <label>Filter</label>
90 </html>
91 <add>1.5</add>
92 </field>
93 <field>
94 <name>is_default</name>
95 <title>Option is Default?</title>
96 <type>boolean</type>
97 <default>0</default>
98 <comment>Is this the default option for the group?</comment>
99 <add>1.5</add>
100 </field>
101 <field>
102 <name>weight</name>
103 <title>Order</title>
104 <type>int unsigned</type>
105 <required>true</required>
106 <comment>Controls display sort order.</comment>
107 <add>1.5</add>
108 </field>
109 <field>
110 <name>description</name>
111 <title>Option Description</title>
112 <type>text</type>
113 <html>
114 <type>TextArea</type>
115 <rows>8</rows>
116 <cols>60</cols>
117 </html>
118 <localizable>true</localizable>
119 <comment>Optional description.</comment>
120 <add>1.5</add>
121 </field>
122 <field>
123 <name>is_optgroup</name>
124 <title>Option is Header?</title>
125 <type>boolean</type>
126 <default>0</default>
127 <comment>Is this row simply a display header? Expected usage is to render these as OPTGROUP tags within a SELECT field list of options?</comment>
128 <add>1.5</add>
129 </field>
130 <field>
131 <name>is_reserved</name>
132 <title>Option Is Reserved?</title>
133 <type>boolean</type>
134 <default>0</default>
135 <comment>Is this a predefined system object?</comment>
136 <add>1.5</add>
137 </field>
138 <field>
139 <name>is_active</name>
140 <title>Option Is Active</title>
141 <type>boolean</type>
142 <default>1</default>
143 <comment>Is this option active?</comment>
144 <add>1.5</add>
145 </field>
146 <field>
147 <name>component_id</name>
148 <title>Component ID</title>
149 <type>int unsigned</type>
150 <comment>Component that this option value belongs/caters to.</comment>
151 <add>2.0</add>
152 <pseudoconstant>
153 <table>civicrm_component</table>
154 <keyColumn>id</keyColumn>
155 <labelColumn>name</labelColumn>
156 </pseudoconstant>
157 <html>
158 <type>Select</type>
159 <label>Component</label>
160 </html>
161 </field>
162 <foreignKey>
163 <name>component_id</name>
164 <table>civicrm_component</table>
165 <key>id</key>
166 <add>2.0</add>
167 </foreignKey>
168 <field>
169 <name>domain_id</name>
170 <title>Domain ID</title>
171 <type>int unsigned</type>
172 <pseudoconstant>
173 <table>civicrm_domain</table>
174 <keyColumn>id</keyColumn>
175 <labelColumn>name</labelColumn>
176 </pseudoconstant>
177 <comment>Which Domain is this option value for</comment>
178 <html>
179 <label>Domain</label>
180 </html>
181 <add>3.1</add>
182 </field>
183 <foreignKey>
184 <name>domain_id</name>
185 <table>civicrm_domain</table>
186 <key>id</key>
187 <add>3.1</add>
188 </foreignKey>
189 <field>
190 <name>visibility_id</name>
191 <title>Option Visibility</title>
192 <type>int unsigned</type>
193 <default>NULL</default>
194 <add>2.2</add>
195 <pseudoconstant>
196 <optionGroupName>visibility</optionGroupName>
197 </pseudoconstant>
198 </field>
199 <field>
200 <name>icon</name>
201 <title>Icon</title>
202 <type>varchar</type>
203 <length>255</length>
204 <default>NULL</default>
205 <comment>crm-i icon class</comment>
206 <add>4.7</add>
207 </field>
208 <field>
209 <name>color</name>
210 <title>Color</title>
211 <type>varchar</type>
212 <length>255</length>
213 <comment>Hex color value e.g. #ffffff</comment>
214 <default>NULL</default>
215 <add>4.7</add>
216 </field>
217 <index>
218 <name>index_option_group_id_value</name>
219 <fieldName length="128">value</fieldName>
220 <fieldName>option_group_id</fieldName>
221 <add>1.5</add>
222 </index>
223 <index>
224 <name>index_option_group_id_name</name>
225 <fieldName length="128">name</fieldName>
226 <fieldName>option_group_id</fieldName>
227 <add>2.2</add>
228 </index>
229 </table>