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