<?xml version="1.0" encoding="iso-8859-1" ?>

<table>
  <base>CRM/Core</base>
  <class>OptionValue</class>
  <name>civicrm_option_value</name>
  <add>1.5</add>
  <log>true</log>
  <paths>
    <update>civicrm/admin/options/[option_group_id:name]?reset=1&amp;action=update&amp;id=[id]</update>
    <delete>civicrm/admin/options/[option_group_id:name]?reset=1&amp;action=delete&amp;id=[id]</delete>
  </paths>
  <field>
    <name>id</name>
    <title>Option Value ID</title>
    <type>int unsigned</type>
    <required>true</required>
    <comment>Option ID</comment>
    <add>1.5</add>
  </field>
  <primaryKey>
    <name>id</name>
    <autoincrement>true</autoincrement>
  </primaryKey>
  <field>
    <name>option_group_id</name>
    <title>Option Group ID</title>
    <type>int unsigned</type>
    <required>true</required>
    <comment>Group which this option belongs to.</comment>
    <add>1.5</add>
    <pseudoconstant>
      <table>civicrm_option_group</table>
      <keyColumn>id</keyColumn>
      <nameColumn>name</nameColumn>
      <labelColumn>title</labelColumn>
    </pseudoconstant>
    <html>
      <type>Select</type>
      <label>Option Group</label>
    </html>
  </field>
  <foreignKey>
    <name>option_group_id</name>
    <table>civicrm_option_group</table>
    <key>id</key>
    <add>1.5</add>
    <onDelete>CASCADE</onDelete>
  </foreignKey>
  <field>
    <name>label</name>
    <title>Option Label</title>
    <type>varchar</type>
    <required>true</required>
    <length>512</length>
    <localizable>true</localizable>
    <comment>Option string as displayed to users - e.g. the label in an HTML OPTION tag.</comment>
    <add>1.5</add>
  </field>
  <field>
    <name>value</name>
    <title>Option Value</title>
    <type>varchar</type>
    <length>512</length>
    <required>true</required>
    <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>
    <add>1.5</add>
    <change>3.3</change>
  </field>
  <field>
    <name>name</name>
    <title>Option Name</title>
    <type>varchar</type>
    <length>255</length>
    <import>true</import>
    <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>
    <add>1.5</add>
  </field>
  <field>
    <name>grouping</name>
    <title>Option Grouping Name</title>
    <type>varchar</type>
    <length>255</length>
    <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>
    <add>1.5</add>
  </field>
  <field>
    <name>filter</name>
    <type>int unsigned</type>
    <default>0</default>
    <comment>Bitwise logic can be used to create subsets of options within an option_group for different uses.</comment>
    <html>
      <label>Filter</label>
    </html>
    <add>1.5</add>
  </field>
  <field>
    <name>is_default</name>
    <title>Option is Default?</title>
    <type>boolean</type>
    <default>0</default>
    <html>
      <type>CheckBox</type>
      <label>Default</label>
    </html>
    <comment>Is this the default option for the group?</comment>
    <add>1.5</add>
  </field>
  <field>
    <name>weight</name>
    <title>Order</title>
    <type>int unsigned</type>
    <required>true</required>
    <comment>Controls display sort order.</comment>
    <add>1.5</add>
  </field>
  <field>
    <name>description</name>
    <title>Option Description</title>
    <type>text</type>
    <html>
      <type>TextArea</type>
      <rows>8</rows>
      <cols>60</cols>
    </html>
    <localizable>true</localizable>
    <comment>Optional description.</comment>
    <add>1.5</add>
  </field>
  <field>
    <name>is_optgroup</name>
    <title>Option is Header?</title>
    <type>boolean</type>
    <default>0</default>
    <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>
    <add>1.5</add>
  </field>
  <field>
    <name>is_reserved</name>
    <title>Option Is Reserved?</title>
    <type>boolean</type>
    <default>0</default>
    <comment>Is this a predefined system object?</comment>
    <add>1.5</add>
  </field>
  <field>
    <name>is_active</name>
    <title>Option Is Active</title>
    <type>boolean</type>
    <default>1</default>
    <html>
      <type>CheckBox</type>
      <label>Enabled</label>
    </html>
    <comment>Is this option active?</comment>
    <add>1.5</add>
  </field>
  <field>
    <name>component_id</name>
    <title>Component ID</title>
    <type>int unsigned</type>
    <comment>Component that this option value belongs/caters to.</comment>
    <add>2.0</add>
    <pseudoconstant>
      <table>civicrm_component</table>
      <keyColumn>id</keyColumn>
      <labelColumn>name</labelColumn>
    </pseudoconstant>
    <html>
      <type>Select</type>
      <label>Component</label>
    </html>
  </field>
  <foreignKey>
    <name>component_id</name>
    <table>civicrm_component</table>
    <key>id</key>
    <add>2.0</add>
  </foreignKey>
  <field>
    <name>domain_id</name>
    <title>Domain ID</title>
    <type>int unsigned</type>
    <pseudoconstant>
      <table>civicrm_domain</table>
      <keyColumn>id</keyColumn>
      <labelColumn>name</labelColumn>
    </pseudoconstant>
    <comment>Which Domain is this option value for</comment>
    <html>
      <label>Domain</label>
    </html>
    <add>3.1</add>
  </field>
  <foreignKey>
    <name>domain_id</name>
    <table>civicrm_domain</table>
    <key>id</key>
    <add>3.1</add>
  </foreignKey>
  <field>
    <name>visibility_id</name>
    <title>Option Visibility</title>
    <type>int unsigned</type>
    <default>NULL</default>
    <add>2.2</add>
    <pseudoconstant>
      <optionGroupName>visibility</optionGroupName>
    </pseudoconstant>
  </field>
  <field>
    <name>icon</name>
    <title>Icon</title>
    <type>varchar</type>
    <length>255</length>
    <default>NULL</default>
    <comment>crm-i icon class</comment>
    <add>4.7</add>
  </field>
  <field>
    <name>color</name>
    <title>Color</title>
    <type>varchar</type>
    <length>255</length>
    <comment>Hex color value e.g. #ffffff</comment>
    <default>NULL</default>
    <add>4.7</add>
  </field>
  <index>
    <name>index_option_group_id_value</name>
    <fieldName length="128">value</fieldName>
    <fieldName>option_group_id</fieldName>
    <add>1.5</add>
  </index>
  <index>
    <name>index_option_group_id_name</name>
    <fieldName length="128">name</fieldName>
    <fieldName>option_group_id</fieldName>
    <add>2.2</add>
  </index>
</table>
