You are here

function uc_csv_schema in Ubercart CSV 6.2

Same name and namespace in other branches
  1. 7.2 uc_csv.install \uc_csv_schema()

Implementation of hook_schema()

File

./uc_csv.install, line 11
This defines our schema for the module

Code

function uc_csv_schema() {
  $schema['uc_csv_reports'] = array(
    'description' => 'A table of configured reports',
    'fields' => array(
      'rid' => array(
        'description' => 'The export report key.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'report_name' => array(
        'description' => 'The name of the report',
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
      ),
      'last_exported' => array(
        'description' => 'The date of the last export',
        'type' => 'datetime',
        'size' => 'normal',
        'not null' => TRUE,
      ),
      'last_order_id' => array(
        'description' => 'The last order id exported',
        'type' => 'int',
        'length' => 11,
        'not null' => TRUE,
      ),
      'shipping_address' => array(
        'description' => 'Include shipping report in export.',
        'type' => 'int',
        'length' => 1,
        'not null' => TRUE,
      ),
      'billing_address' => array(
        'description' => 'Include billing address in export',
        'type' => 'int',
        'length' => 1,
        'not null' => TRUE,
      ),
      'products' => array(
        'description' => 'Include products in export',
        'type' => 'int',
        'length' => 1,
        'not null' => TRUE,
      ),
      'orderby' => array(
        'description' => 'How the report is to be ordered',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
      ),
      'file_type' => array(
        'description' => 'The type of file to be exported',
        'type' => 'varchar',
        'length' => 3,
        'not null' => TRUE,
        'default' => 'csv',
      ),
      'statuses' => array(
        'description' => 'The order statuses to be included in this report',
        'type' => 'text',
        'size' => 'medium',
        'not null' => TRUE,
      ),
      'track' => array(
        'description' => 'Should this report track last exports. Boolean.',
        'type' => 'int',
        'length' => 1,
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'rid',
    ),
  );
  return $schema;
}