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

<table>
  <!--
    NOTE: To facilitate upgrades, manually copy any ALTER TABLE statements to CRM_Queue_BAO_QueueItem.
  -->
  <base>CRM/Queue</base>
  <class>QueueItem</class>
  <name>civicrm_queue_item</name>
  <comment>Stores a list of queue items</comment>
  <add>4.2</add>
  <field>
    <name>id</name>
    <title>Queue Item ID</title>
    <type>int unsigned</type>
    <required>true</required>
    <html>
      <type>Number</type>
    </html>
  </field>
  <primaryKey>
    <name>id</name>
    <autoincrement>true</autoincrement>
  </primaryKey>
  <field>
    <name>queue_name</name>
    <title>Queue Name</title>
    <type>varchar</type>
    <length>64</length>
    <comment>Name of the queue which includes this item</comment>
    <!-- This SHOULD match `civicrm_queue.name`; however, historically, it has been required to create records in `civicrm_queue`. -->
    <required>true</required>
    <html>
      <type>Text</type>
    </html>
  </field>
  <field>
    <name>weight</name>
    <title>Order</title>
    <type>int</type>
    <required>true</required>
    <html>
      <type>Text</type>
    </html>
  </field>
  <field>
    <name>submit_time</name>
    <title>Submit Time</title>
    <type>timestamp</type>
    <comment>date on which this item was submitted to the queue</comment>
    <required>true</required>
    <html>
      <type>Select Date</type>
      <formatType>activityDateTime</formatType>
    </html>
  </field>
  <field>
    <name>release_time</name>
    <title>Release Time</title>
    <type>timestamp</type>
    <required>false</required>
    <default>NULL</default>
    <comment>date on which this job becomes available; null if ASAP</comment>
    <html>
      <type>Select Date</type>
      <formatType>activityDateTime</formatType>
    </html>
  </field>
  <field>
    <name>run_count</name>
    <title>Run Count</title>
    <comment>Number of times execution has been attempted.</comment>
    <type>int</type>
    <default>0</default>
    <required>true</required>
    <html>
      <type>Text</type>
    </html>
    <add>5.48</add>
  </field>
  <field>
    <name>data</name>
    <title>Queue item data</title>
    <type>longtext</type>
    <comment>Serialized queue data</comment>
    <serialize>PHP</serialize>
  </field>
  <index>
    <name>index_queueids</name>
    <fieldName>queue_name</fieldName>
    <fieldName>weight</fieldName>
    <fieldName>id</fieldName>
  </index>
</table>
