<?xml version="1.0" encoding="utf-8" ?>
<table>
  <base>CRM/Activity</base>
  <class>ActivityContact</class>
  <name>civicrm_activity_contact</name>
  <comment>Activity Contact</comment>
  <archive>true</archive>
  <add>4.4</add>
  <log>true</log>
  <field>
    <name>id</name>
    <type>int unsigned</type>
    <title>Activity Contact ID</title>
    <required>true</required>
    <comment>Activity contact id</comment>
    <html>
      <type>Number</type>
    </html>
    <add>4.4</add>
  </field>
  <primaryKey>
    <name>id</name>
    <autoincrement>true</autoincrement>
  </primaryKey>
   <field>
    <name>activity_id</name>
    <type>int unsigned</type>
    <title>Activity ID</title>
    <required>true</required>
    <comment>Foreign key to the activity for this record.</comment>
    <html>
      <label>Activity</label>
    </html>
    <add>4.4</add>
   </field>
   <foreignKey>
    <name>activity_id</name>
    <table>civicrm_activity</table>
    <key>id</key>
    <add>4.4</add>
    <onDelete>CASCADE</onDelete>
  </foreignKey>
   <field>
    <name>contact_id</name>
    <title>Contact ID</title>
    <import>true</import>
    <type>int unsigned</type>
    <required>true</required>
    <comment>Foreign key to the contact for this record.</comment>
    <html>
      <label>Contact</label>
    </html>
    <add>4.4</add>
   </field>
   <foreignKey>
    <name>contact_id</name>
    <table>civicrm_contact</table>
    <key>id</key>
    <add>4.4</add>
    <onDelete>CASCADE</onDelete>
  </foreignKey>
  <field>
    <name>record_type_id</name>
    <type>int unsigned</type>
    <title>Activity Contact Type</title>
    <comment>Determines the contact's role in the activity (source, target, or assignee).</comment>
    <pseudoconstant>
      <optionGroupName>activity_contacts</optionGroupName>
    </pseudoconstant>
    <html>
      <type>Select</type>
      <label>Contact Role</label>
    </html>
    <add>4.4</add>
  </field>
  <index>
    <name>UI_activity_contact</name>
    <fieldName>contact_id</fieldName>
    <fieldName>activity_id</fieldName>
    <fieldName>record_type_id</fieldName>
    <unique>true</unique>
    <add>4.4</add>
  </index>
  <index>
    <name>index_record_type</name>
    <fieldName>activity_id</fieldName>
    <fieldName>record_type_id</fieldName>
    <add>4.4</add>
  </index>
</table>
