You are here

function uc_csv_schema in Ubercart CSV 7.2

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

Implements of hook_schema

1 call to uc_csv_schema()
uc_csv_update_7206 in ./uc_csv.install
Add fields to allow emailing of reports to specific users when reports are generated

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',
        'mysql_type' => 'datetime',
        'type' => NULL,
      ),
      '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' => 8,
        '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,
      ),
      'email_enable' => array(
        'description' => 'Are we emailing this report when generated',
        'type' => 'int',
        'length' => 1,
        'not null' => TRUE,
      ),
      'email_address' => array(
        'description' => 'Email address to send report to.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'rid',
    ),
  );
  return $schema;
}