<?xml version="1.0" encoding="utf-8" ?>
<table>
  <base>CRM/Dedupe</base>
  <class>DedupeRuleGroup</class>
  <name>civicrm_dedupe_rule_group</name>
  <comment>Dedupe rule groups</comment>
  <add>1.8</add>
  <field>
    <name>id</name>
    <title>Rule Group ID</title>
    <type>int unsigned</type>
    <required>true</required>
    <comment>Unique dedupe rule group id</comment>
    <html>
      <type>Number</type>
    </html>
    <add>1.8</add>
  </field>
  <primaryKey>
    <name>id</name>
    <autoincrement>true</autoincrement>
  </primaryKey>
  <field>
    <name>contact_type</name>
    <title>Contact Type</title>
    <type>varchar</type>
    <length>12</length>
    <comment>The type of contacts this group applies to</comment>
    <pseudoconstant>
      <table>civicrm_contact_type</table>
      <keyColumn>name</keyColumn>
      <labelColumn>label</labelColumn>
      <condition>parent_id IS NULL</condition>
    </pseudoconstant>
    <add>1.8</add>
    <html>
      <type>Select</type>
    </html>
  </field>
  <field>
    <name>threshold</name>
    <title>Threshold</title>
    <type>int</type>
    <required>true</required>
    <comment>The weight threshold the sum of the rule weights has to cross to consider two contacts the same</comment>
    <add>1.8</add>
    <html>
      <type>Text</type>
    </html>
  </field>
  <field>
    <name>used</name>
    <type>varchar</type>
    <title>Length</title>
    <length>12</length>
    <required>true</required>
    <comment>Whether the rule should be used for cases where usage is Unsupervised, Supervised OR General(programatically)</comment>
    <pseudoconstant>
      <callback>CRM_Core_SelectValues::getDedupeRuleTypes</callback>
    </pseudoconstant>
    <add>4.3</add>
    <html>
      <type>Radio</type>
    </html>
  </field>
  <field>
    <name>name</name>
    <title>Name</title>
    <type>varchar</type>
    <length>255</length>
    <comment>Unique name of rule group</comment>
    <add>2.1</add>
  </field>
  <index>
    <name>UI_name</name>
    <fieldName>name</fieldName>
    <unique>true</unique>
    <add>5.54</add>
  </index>
  <field>
    <name>title</name>
    <title>Title</title>
    <type>varchar</type>
    <length>255</length>
    <comment>Label of the rule group</comment>
    <add>4.1</add>
    <html>
      <type>Text</type>
    </html>
  </field>
  <field>
    <name>is_reserved</name>
    <title>Reserved?</title>
    <type>boolean</type>
    <comment>Is this a reserved rule - a rule group that has been optimized and cannot be changed by the admin</comment>
    <default>0</default>
    <required>true</required>
    <add>4.1</add>
    <html>
      <type>CheckBox</type>
    </html>
  </field>
</table>
