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

<table>
  <base>CRM/Contribute</base>
  <class>PremiumsProduct</class>
  <name>civicrm_premiums_product</name>
  <comment>joins premiums (settings) to individual product/premium items - determines which products are available for a given contribution page</comment>
  <add>1.4</add>
  <log>true</log>
  <component>CiviContribute</component>
  <title>Product Premium</title>
  <titlePlural>Product Premiums</titlePlural>
  <field>
    <name>id</name>
    <title>Premium Product ID</title>
    <type>int unsigned</type>
    <required>true</required>
    <comment>Contribution ID</comment>
    <html>
      <type>Number</type>
    </html>
    <add>1.4</add>
  </field>
  <primaryKey>
    <name>id</name>
    <autoincrement>true</autoincrement>
  </primaryKey>
  <field>
    <name>premiums_id</name>
    <title>Premium ID</title>
    <type>int unsigned</type>
    <required>true</required>
    <comment>Foreign key to premiums settings record.</comment>
    <html>
      <label>Premium</label>
    </html>
    <add>1.4</add>
  </field>
  <foreignKey>
    <name>premiums_id</name>
    <table>civicrm_premiums</table>
    <key>id</key>
    <add>1.4</add>
  </foreignKey>
  <field>
    <name>product_id</name>
    <title>Product ID</title>
    <type>int unsigned</type>
    <required>true</required>
    <comment>Foreign key to each product object.</comment>
    <html>
      <label>Product</label>
    </html>
    <add>1.4</add>
  </field>
  <foreignKey>
    <name>product_id</name>
    <table>civicrm_product</table>
    <key>id</key>
    <add>1.4</add>
  </foreignKey>
  <field>
    <name>weight</name>
    <title>Order</title>
    <type>int unsigned</type>
    <required>true</required>
    <add>2.0</add>
  </field>
  <field>
    <name>financial_type_id</name>
    <title>Financial Type ID</title>
    <type>int unsigned</type>
    <default>NULL</default>
    <pseudoconstant>
      <table>civicrm_financial_type</table>
      <keyColumn>id</keyColumn>
      <labelColumn>name</labelColumn>
    </pseudoconstant>
    <comment>FK to Financial Type.</comment>
    <html>
      <label>Financial Type</label>
    </html>
    <add>4.3</add>
  </field>
  <foreignKey>
    <name>financial_type_id</name>
    <table>civicrm_financial_type</table>
    <key>id</key>
    <onDelete>SET NULL</onDelete>
    <add>4.3</add>
  </foreignKey>
</table>
