Merge remote-tracking branch 'upstream/4.3' into 4.3-master-2013-09-25-01-46-57
[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 <type>int unsigned</type>
12 <required>true</required>
13 <comment>Option ID</comment>
14 <add>1.5</add>
15 </field>
16 <primaryKey>
17 <name>id</name>
18 <autoincrement>true</autoincrement>
19 </primaryKey>
20 <field>
21 <name>option_group_id</name>
22 <type>int unsigned</type>
23 <required>true</required>
24 <comment>Group which this option belongs to.</comment>
25 <add>1.5</add>
26 <pseudoconstant>
27 <table>civicrm_option_group</table>
28 <keyColumn>id</keyColumn>
29 <labelColumn>name</labelColumn>
30 </pseudoconstant>
31 </field>
32 <foreignKey>
33 <name>option_group_id</name>
34 <table>civicrm_option_group</table>
35 <key>id</key>
36 <add>1.5</add>
37 <onDelete>CASCADE</onDelete>
38 </foreignKey>
39 <field>
40 <name>label</name>
41 <title>Option Label</title>
42 <type>varchar</type>
43 <required>true</required>
44 <length>255</length>
45 <localizable>true</localizable>
46 <comment>Option string as displayed to users - e.g. the label in an HTML OPTION tag.</comment>
47 <add>1.5</add>
48 </field>
49 <field>
50 <name>value</name>
51 <title>Option Value</title>
52 <type>varchar</type>
53 <length>512</length>
54 <required>true</required>
55 <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>
56 <add>1.5</add>
57 <change>3.3</change>
58 </field>
59 <field>
60 <name>name</name>
61 <title>Option Name</title>
62 <type>varchar</type>
63 <length>255</length>
64 <import>true</import>
65 <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>
66 <add>1.5</add>
67 </field>
68 <field>
69 <name>grouping</name>
70 <title>Option Grouping Name</title>
71 <type>varchar</type>
72 <length>255</length>
73 <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>
74 <add>1.5</add>
75 </field>
76 <field>
77 <name>filter</name>
78 <type>int unsigned</type>
79 <comment>Bitwise logic can be used to create subsets of options within an option_group for different uses.</comment>
80 <add>1.5</add>
81 </field>
82 <field>
83 <name>is_default</name>
84 <type>boolean</type>
85 <default>0</default>
86 <comment>Is this the default option for the group?</comment>
87 <add>1.5</add>
88 </field>
89 <field>
90 <name>weight</name>
91 <type>int unsigned</type>
92 <required>true</required>
93 <comment>Controls display sort order.</comment>
94 <add>1.5</add>
95 </field>
96 <field>
97 <name>description</name>
98 <type>text</type>
99 <htmlType>textarea</htmlType>
100 <rows>8</rows>
101 <cols>60</cols>
102 <localizable>true</localizable>
103 <comment>Optional description.</comment>
104 <add>1.5</add>
105 </field>
106 <field>
107 <name>is_optgroup</name>
108 <type>boolean</type>
109 <default>0</default>
110 <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>
111 <add>1.5</add>
112 </field>
113 <field>
114 <name>is_reserved</name>
115 <type>boolean</type>
116 <default>0</default>
117 <comment>Is this a predefined system object?</comment>
118 <add>1.5</add>
119 </field>
120 <field>
121 <name>is_active</name>
122 <type>boolean</type>
123 <default>1</default>
124 <comment>Is this option active?</comment>
125 <add>1.5</add>
126 </field>
127 <field>
128 <name>component_id</name>
129 <type>int unsigned</type>
130 <comment>Component that this option value belongs/caters to.</comment>
131 <add>2.0</add>
132 <pseudoconstant>
133 <table>civicrm_component</table>
134 <keyColumn>id</keyColumn>
135 <labelColumn>name</labelColumn>
136 </pseudoconstant>
137 </field>
138 <foreignKey>
139 <name>component_id</name>
140 <table>civicrm_component</table>
141 <key>id</key>
142 <add>2.0</add>
143 </foreignKey>
144 <field>
145 <name>domain_id</name>
146 <type>int unsigned</type>
147 <comment>Which Domain is this option value for</comment>
148 <add>3.1</add>
149 </field>
150 <foreignKey>
151 <name>domain_id</name>
152 <table>civicrm_domain</table>
153 <key>id</key>
154 <add>3.1</add>
155 </foreignKey>
156 <field>
157 <name>visibility_id</name>
158 <type>int unsigned</type>
159 <default>NULL</default>
160 <add>2.2</add>
161 </field>
162 <index>
163 <name>index_option_group_id_value</name>
164 <fieldName length="128">value</fieldName>
165 <fieldName>option_group_id</fieldName>
166 <add>1.5</add>
167 </index>
168 <index>
169 <name>index_option_group_id_name</name>
170 <fieldName length="128">name</fieldName>
171 <fieldName>option_group_id</fieldName>
172 <add>2.2</add>
173 </index>
174 </table>