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

<table>
  <base>CRM/Core</base>
  <class>County</class>
  <name>civicrm_county</name>
  <add>1.1</add>
  <labelField>name</labelField>
  <field>
    <name>id</name>
    <title>County ID</title>
    <type>int unsigned</type>
    <required>true</required>
    <comment>County ID</comment>
    <html>
      <type>Number</type>
    </html>
    <add>1.1</add>
  </field>
  <primaryKey>
    <name>id</name>
    <autoincrement>true</autoincrement>
  </primaryKey>
  <field>
    <name>name</name>
    <title>County</title>
    <type>varchar</type>
    <length>64</length>
    <import>true</import>
    <headerPattern>/county/i</headerPattern>
    <dataPattern>/[A-Z]{2}/</dataPattern>
    <comment>Name of County</comment>
    <add>1.1</add>
  </field>
  <field>
    <name>abbreviation</name>
    <title>County Abbreviation</title>
    <type>varchar</type>
    <length>4</length>
    <comment>2-4 Character Abbreviation of County</comment>
    <add>1.1</add>
  </field>
  <field>
    <name>state_province_id</name>
    <title>State ID</title>
    <type>int unsigned</type>
    <required>true</required>
    <comment>ID of State/Province that County belongs</comment>
    <html>
      <label>State</label>
    </html>
    <add>1.1</add>
    <pseudoconstant>
      <table>civicrm_state_province</table>
      <keyColumn>id</keyColumn>
      <labelColumn>name</labelColumn>
      <abbrColumn>abbreviation</abbrColumn>
    </pseudoconstant>
  </field>
  <foreignKey>
    <name>state_province_id</name>
    <table>civicrm_state_province</table>
    <key>id</key>
    <add>1.1</add>
  </foreignKey>
  <field>
    <name>is_active</name>
    <title>County Is Active</title>
    <type>boolean</type>
    <default>1</default>
    <required>true</required>
    <html>
      <type>CheckBox</type>
      <label>Enabled</label>
    </html>
    <comment>Is this County active?</comment>
    <add>5.35</add>
  </field>
  <index>
    <name>UI_name_state_id</name>
    <fieldName>name</fieldName>
    <fieldName>state_province_id</fieldName>
    <unique>true</unique>
    <add>1.1</add>
  </index>
</table>
