<?xml version="1.0" encoding="iso-8859-1" ?>
<table>
  <base>CRM/Case</base>
  <class>Case</class>
  <name>civicrm_case</name>
  <description>Collections of activities and relationships for a given purpose.</description>
  <comment>This table stores information about cases grouping activities.</comment>
  <add>1.8</add>
  <log>true</log>
  <icon>fa-folder-open</icon>
  <labelField>subject</labelField>
  <component>CiviCase</component>
  <paths>
    <view>civicrm/contact/view/case?action=view&amp;reset=1&amp;id=[id]</view>
  </paths>
  <field>
    <name>id</name>
    <type>int unsigned</type>
    <uniqueName>case_id</uniqueName>
    <required>true</required>
    <import>true</import>
    <title>Case ID</title>
    <comment>Unique Case ID</comment>
    <html>
      <type>Number</type>
    </html>
    <add>1.8</add>
  </field>
  <primaryKey>
    <name>id</name>
    <autoincrement>true</autoincrement>
  </primaryKey>
  <field>
    <name>case_type_id</name>
    <type>int unsigned</type>
    <import>true</import>
    <export>false</export>
    <title>Case Type ID</title>
    <required>true</required>
    <comment>FK to civicrm_case_type.id</comment>
    <html>
      <type>Select</type>
      <label>Case Type</label>
    </html>
    <pseudoconstant>
      <table>civicrm_case_type</table>
      <keyColumn>id</keyColumn>
      <labelColumn>title</labelColumn>
    </pseudoconstant>
    <add>2.0</add>
  </field>
  <index>
    <name>index_case_type_id</name>
    <fieldName>case_type_id</fieldName>
    <add>2.0</add>
  </index>
  <foreignKey>
    <name>case_type_id</name>
    <table>civicrm_case_type</table>
    <key>id</key>
    <add>4.5</add>
  </foreignKey>
  <field>
    <name>subject</name>
    <type>varchar</type>
    <length>128</length>
    <title>Case Subject</title>
    <import>true</import>
    <uniqueName>case_subject</uniqueName>
    <comment>Short name of the case.</comment>
    <html>
      <type>Text</type>
    </html>
    <add>1.8</add>
  </field>
  <field>
    <name>start_date</name>
    <uniqueName>case_start_date</uniqueName>
    <title>Case Start Date</title>
    <import>true</import>
    <type>date</type>
    <comment>Date on which given case starts.</comment>
    <html>
      <type>Select Date</type>
      <formatType>activityDate</formatType>
    </html>
    <add>1.8</add>
  </field>
  <field>
    <name>end_date</name>
    <uniqueName>case_end_date</uniqueName>
    <title>Case End Date</title>
    <import>true</import>
    <type>date</type>
    <comment>Date on which given case ends.</comment>
    <html>
      <type>Select Date</type>
      <formatType>activityDate</formatType>
    </html>
    <add>1.8</add>
  </field>
  <field>
    <name>details</name>
    <type>text</type>
    <html>
      <type>TextArea</type>
      <rows>8</rows>
      <cols>60</cols>
      <label>Details</label>
    </html>
    <comment>Details populated from Open Case. Only used in the CiviCase extension.</comment>
    <add>1.8</add>
  </field>
  <field>
    <name>status_id</name>
    <type>int unsigned</type>
    <uniqueName>case_status_id</uniqueName>
    <required>true</required>
    <import>true</import>
    <export>false</export>
    <title>Case Status</title>
    <comment>ID of case status.</comment>
    <pseudoconstant>
      <optionGroupName>case_status</optionGroupName>
    </pseudoconstant>
    <html>
      <type>Select</type>
      <controlField>case_type_id</controlField>
    </html>
    <add>1.8</add>
  </field>
  <field>
    <name>is_deleted</name>
    <title>Case is in the Trash</title>
    <uniqueName>case_deleted</uniqueName>
    <type>boolean</type>
    <default>0</default>
    <required>true</required>
    <import>true</import>
    <html>
      <type>CheckBox</type>
    </html>
    <add>2.2</add>
  </field>
  <index>
    <name>index_is_deleted</name>
    <fieldName>is_deleted</fieldName>
    <add>2.2</add>
  </index>
  <field>
    <name>created_date</name>
    <uniqueName>case_created_date</uniqueName>
    <type>timestamp</type>
    <comment>When was the case was created.</comment>
    <required>false</required>
    <export>true</export>
    <default>NULL</default>
    <html>
      <label>Created Date</label>
    </html>
    <readonly>true</readonly>
    <add>4.7</add>
  </field>
  <field>
    <name>modified_date</name>
    <uniqueName>case_modified_date</uniqueName>
    <type>timestamp</type>
    <comment>When was the case (or closely related entity) was created or modified or deleted.</comment>
    <required>false</required>
    <export>true</export>
    <default>CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP</default>
    <html>
      <label>Modified Date</label>
    </html>
    <readonly>true</readonly>
    <add>4.7</add>
  </field>
</table>
