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

<table>
  <base>CRM/Contact</base>
  <class>ACLContactCache</class>
  <name>civicrm_acl_contact_cache</name>
  <comment>Join table cache for contacts that a user has permission on.</comment>
  <add>3.1</add>
  <field>
    <name>id</name>
    <title>ACL Contact Cache ID</title>
    <type>int unsigned</type>
    <required>true</required>
    <comment>primary key</comment>
    <html>
      <type>Number</type>
    </html>
    <add>3.1</add>
  </field>
  <primaryKey>
    <name>id</name>
    <autoincrement>true</autoincrement>
  </primaryKey>
  <field>
    <name>user_id</name>
    <title>Contact ID</title>
    <type>int unsigned</type>
    <comment>FK to civicrm_contact (could be null for anon user)</comment>
    <add>3.1</add>
  </field>
  <field>
    <name>contact_id</name>
    <title>Contact ID</title>
    <type>int unsigned</type>
    <required>true</required>
    <comment>FK to civicrm_contact</comment>
    <html>
      <label>Contact</label>
    </html>
    <add>3.1</add>
  </field>
  <foreignKey>
    <name>contact_id</name>
    <table>civicrm_contact</table>
    <key>id</key>
    <add>3.1</add>
    <drop>5.31</drop>
    <onDelete>CASCADE</onDelete>
  </foreignKey>
  <field>
    <name>operation</name>
    <title>Operation</title>
    <type>varchar</type>
    <length>8</length>
    <required>true</required>
    <comment>What operation does this user have permission on?</comment>
    <pseudoconstant>
      <callback>CRM_ACL_BAO_ACL::operation</callback>
    </pseudoconstant>
    <add>1.6</add>
    <html>
      <type>Select</type>
    </html>
  </field>
  <index>
    <name>UI_user_contact_operation</name>
    <fieldName>user_id</fieldName>
    <fieldName>contact_id</fieldName>
    <fieldName>operation</fieldName>
    <unique>true</unique>
    <add>3.1</add>
  </index>
</table>
