You are here

function uc_payment_pack_schema in Ubercart 8.4

Same name and namespace in other branches
  1. 6.2 payment/uc_payment_pack/uc_payment_pack.install \uc_payment_pack_schema()
  2. 7.3 payment/uc_payment_pack/uc_payment_pack.install \uc_payment_pack_schema()

Implements hook_schema().

File

payment/uc_payment_pack/uc_payment_pack.install, line 11
Install, update and uninstall functions for the uc_payment_pack module.

Code

function uc_payment_pack_schema() {
  $schema = [];
  $schema['uc_payment_check'] = [
    'description' => 'Stores check payment information.',
    'fields' => [
      'check_id' => [
        'description' => 'Primary key: the check ID.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ],
      'order_id' => [
        'description' => 'The {uc_orders}.order_id.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ],
      'clear_date' => [
        'description' => 'The Unix timestamp indicating the expected clear date for the check.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ],
    ],
    'indexes' => [
      'order_id' => [
        'order_id',
      ],
    ],
    'primary key' => [
      'check_id',
    ],
    'foreign keys' => [
      'uc_orders' => [
        'table' => 'uc_orders',
        'columns' => [
          'order_id' => 'order_id',
        ],
      ],
    ],
  ];
  $schema['uc_payment_cod'] = [
    'description' => 'Stores COD payment information.',
    'fields' => [
      'order_id' => [
        'description' => 'The {uc_orders}.order_id.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ],
      'delivery_date' => [
        'description' => 'The Unix timestamp indicating the desired delivery date for the order.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ],
    ],
    'primary key' => [
      'order_id',
    ],
    'foreign keys' => [
      'uc_orders' => [
        'table' => 'uc_orders',
        'columns' => [
          'order_id' => 'order_id',
        ],
      ],
    ],
  ];
  $schema['uc_payment_other'] = [
    'description' => 'Stores Other payment type information.',
    'fields' => [
      'order_id' => [
        'description' => 'The {uc_orders}.order_id.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ],
      'description' => [
        'description' => 'The description of the payment type.',
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
        'default' => '',
      ],
    ],
    'primary key' => [
      'order_id',
    ],
    'foreign keys' => [
      'uc_orders' => [
        'table' => 'uc_orders',
        'columns' => [
          'order_id' => 'order_id',
        ],
      ],
    ],
  ];
  return $schema;
}