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

<table>
  <base>CRM/Contact</base>
  <class>Group</class>
  <name>civicrm_group</name>
  <comment>Provide grouping of related contacts</comment>
  <add>1.1</add>
  <log>true</log>
  <icon>fa-users</icon>
  <labelField>title</labelField>
  <paths>
    <add>civicrm/group/add?reset=1</add>
    <view>civicrm/group/search?force=1&amp;context=smog&amp;gid=[id]&amp;component_mode=1</view>
    <update>civicrm/group/edit?reset=1&amp;action=update&amp;id=[id]</update>
    <delete>civicrm/group/edit?reset=1&amp;action=delete&amp;id=[id]</delete>
    <browse>civicrm/group</browse>
  </paths>
  <field>
    <name>id</name>
    <type>int unsigned</type>
    <title>Group ID</title>
    <required>true</required>
    <comment>Group ID</comment>
    <html>
      <type>Number</type>
    </html>
    <add>1.1</add>
  </field>
  <primaryKey>
    <name>id</name>
    <autoincrement>true</autoincrement>
  </primaryKey>
  <field>
    <name>name</name>
    <type>varchar</type>
    <title>Group Name</title>
    <length>64</length>
    <required>true</required>
    <comment>Internal name of Group.</comment>
    <add>1.1</add>
  </field>
  <field>
    <name>title</name>
    <type>varchar</type>
    <title>Group Title</title>
    <length>255</length>
    <required>true</required>
    <localizable>true</localizable>
    <comment>Name of Group.</comment>
    <add>1.1</add>
    <html>
      <type>Text</type>
    </html>
  </field>
  <field>
    <name>description</name>
    <type>text</type>
    <title>Group Description</title>
    <html>
      <type>TextArea</type>
      <rows>2</rows>
      <cols>60</cols>
    </html>
    <comment>Optional verbose description of the group.</comment>
    <add>1.1</add>
  </field>
  <field>
    <name>source</name>
    <type>varchar</type>
    <title>Group Source</title>
    <length>64</length>
    <comment>Module or process which created this group.</comment>
    <add>1.1</add>
  </field>
  <field>
    <name>saved_search_id</name>
    <type>int unsigned</type>
    <title>Saved Search ID</title>
    <comment>FK to saved search table.</comment>
    <html>
      <label>Saved Search</label>
    </html>
    <add>1.1</add>
  </field>
  <foreignKey>
    <name>saved_search_id</name>
    <table>civicrm_saved_search</table>
    <key>id</key>
    <add>1.1</add>
    <onDelete>CASCADE</onDelete>
  </foreignKey>
  <field>
    <name>is_active</name>
    <type>boolean</type>
    <default>1</default>
    <required>true</required>
    <title>Group Enabled</title>
    <html>
      <type>CheckBox</type>
      <label>Enabled</label>
    </html>
    <comment>Is this group active?</comment>
    <add>1.1</add>
  </field>
  <field>
    <name>visibility</name>
    <type>varchar</type>
    <length>24</length>
    <title>Group Visibility Setting</title>
    <default>'User and User Admin Only'</default>
    <comment>In what context(s) is this field visible.</comment>
    <pseudoconstant>
      <callback>CRM_Core_SelectValues::groupVisibility</callback>
    </pseudoconstant>
    <add>1.2</add>
    <html>
      <type>Select</type>
    </html>
  </field>
  <field>
    <name>where_clause</name>
    <type>text</type>
    <title>Group Where Clause</title>
    <comment>the sql where clause if a saved search acl</comment>
    <readonly>true</readonly>
    <deprecated>true</deprecated>
    <add>1.6</add>
  </field>
  <field>
    <name>select_tables</name>
    <type>text</type>
    <title>Tables For Select Clause</title>
    <comment>the tables to be included in a select data</comment>
    <readonly>true</readonly>
    <serialize>PHP</serialize>
    <deprecated>true</deprecated>
    <add>1.6</add>
  </field>
  <field>
    <name>where_tables</name>
    <type>text</type>
    <deprecated>true</deprecated>
    <title>Tables For Where Clause</title>
    <comment>the tables to be included in the count statement</comment>
    <readonly>true</readonly>
    <serialize>PHP</serialize>
    <add>1.6</add>
  </field>
  <field>
    <name>group_type</name>
    <type>varchar</type>
    <title>Group Type</title>
    <length>128</length>
    <comment>FK to group type</comment>
    <pseudoconstant>
      <optionGroupName>group_type</optionGroupName>
    </pseudoconstant>
    <html>
      <type>Select</type>
    </html>
    <serialize>SEPARATOR_BOOKEND</serialize>
    <add>1.9</add>
  </field>
  <field>
    <name>cache_date</name>
    <type>timestamp</type>
    <title>Group Cache Date</title>
    <required>false</required>
    <readonly>true</readonly>
    <comment>Date when we created the cache for a smart group</comment>
    <add>2.1</add>
  </field>
  <index>
    <name>UI_cache_date</name>
    <fieldName>cache_date</fieldName>
    <add>5.34</add>
  </index>
  <field>
    <name>cache_fill_took</name>
    <type>float</type>
    <title>Seconds taken by last cache fill</title>
    <comment>Seconds taken to fill smart group cache</comment>
    <required>false</required>
    <readonly>true</readonly>
    <add>5.67</add>
  </field>
  <field>
    <name>refresh_date</name>
    <type>timestamp</type>
    <title>Next Group Refresh Time</title>
    <required>false</required>
    <readonly>true</readonly>
    <deprecated>true</deprecated>
    <comment>Unused deprecated column.</comment>
    <add>4.3</add>
  </field>
  <field>
    <name>parents</name>
    <type>text</type>
    <title>Group Parents</title>
    <comment>List of parent groups</comment>
    <add>2.1</add>
    <serialize>COMMA</serialize>
    <pseudoconstant>
      <table>civicrm_group</table>
      <keyColumn>id</keyColumn>
      <nameColumn>name</nameColumn>
      <labelColumn>title</labelColumn>
      <prefetch>disabled</prefetch>
    </pseudoconstant>
    <html>
      <type>EntityRef</type>
      <label>Parent Groups</label>
    </html>
  </field>
  <field>
    <name>children</name>
    <type>text</type>
    <title>Group Children</title>
    <comment>List of child groups (calculated)</comment>
    <add>2.1</add>
    <serialize>COMMA</serialize>
    <readonly>true</readonly>
    <pseudoconstant>
      <table>civicrm_group</table>
      <keyColumn>id</keyColumn>
      <nameColumn>name</nameColumn>
      <labelColumn>title</labelColumn>
      <prefetch>disabled</prefetch>
    </pseudoconstant>
    <html>
      <type>EntityRef</type>
      <label>Child Groups</label>
    </html>
  </field>
  <field>
    <name>is_hidden</name>
    <type>boolean</type>
    <title>Group is Hidden</title>
    <default>0</default>
    <required>true</required>
    <comment>Is this group hidden?</comment>
    <add>2.2</add>
  </field>
  <field>
    <name>is_reserved</name>
    <type>boolean</type>
    <title>Group is Reserved</title>
    <default>0</default>
    <required>true</required>
    <add>4.2</add>
  </field>
  <index>
    <name>index_group_type</name>
    <fieldName>group_type</fieldName>
    <add>1.9</add>
  </index>
  <index>
    <name>UI_title</name>
    <fieldName>title</fieldName>
    <unique>true</unique>
    <add>2.1</add>
  </index>
  <index>
    <name>UI_name</name>
    <fieldName>name</fieldName>
    <unique>true</unique>
    <add>2.1</add>
  </index>
  <field>
    <name>created_id</name>
    <type>int unsigned</type>
    <title>Created By Contact ID</title>
    <comment>FK to contact table.</comment>
    <html>
      <label>Created By</label>
    </html>
    <add>4.3</add>
  </field>
  <foreignKey>
    <name>created_id</name>
    <table>civicrm_contact</table>
    <key>id</key>
    <add>4.3</add>
    <onDelete>SET NULL</onDelete>
  </foreignKey>
  <field>
    <name>modified_id</name>
    <type>int unsigned</type>
    <title>Modified By Contact ID</title>
    <comment>FK to contact table.</comment>
    <html>
      <label>Modified By</label>
    </html>
    <readonly>true</readonly>
    <add>4.5</add>
  </field>
  <foreignKey>
    <name>modified_id</name>
    <table>civicrm_contact</table>
    <key>id</key>
    <add>4.5</add>
    <onDelete>SET NULL</onDelete>
  </foreignKey>
  <field>
    <name>frontend_title</name>
    <type>varchar</type>
    <title>Public Group Title</title>
    <length>255</length>
    <localizable>true</localizable>
    <comment>Alternative public title for this Group.</comment>
    <required>TRUE</required>
    <add>5.31</add>
    <html>
      <type>Text</type>
    </html>
  </field>
  <field>
    <name>frontend_description</name>
    <type>text</type>
    <title>Public Group Description</title>
    <html>
      <type>TextArea</type>
      <rows>2</rows>
      <cols>60</cols>
    </html>
    <comment>Alternative public description of the group.</comment>
    <localizable>true</localizable>
    <default>NULL</default>
    <add>5.31</add>
  </field>
</table>
