123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- <?php
- /**
- * @file
- * Install, update and uninstall functions for the uc_payment_pack module.
- */
- /**
- * Implements hook_schema().
- */
- function uc_payment_pack_schema() {
- $schema = array();
- $schema['uc_payment_check'] = array(
- 'description' => 'Stores check payment information.',
- 'fields' => array(
- 'check_id' => array(
- 'description' => 'Primary key: the check ID.',
- 'type' => 'serial',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- ),
- 'order_id' => array(
- 'description' => 'The {uc_orders}.order_id.',
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- 'default' => 0,
- ),
- 'clear_date' => array(
- 'description' => 'The Unix timestamp indicating the expected clear date for the check.',
- 'type' => 'int',
- 'not null' => TRUE,
- 'default' => 0,
- ),
- ),
- 'indexes' => array(
- 'order_id' => array('order_id'),
- ),
- 'primary key' => array('check_id'),
- 'foreign keys' => array(
- 'uc_orders' => array(
- 'table' => 'uc_orders',
- 'columns' => array('order_id' => 'order_id'),
- ),
- ),
- );
- $schema['uc_payment_cod'] = array(
- 'description' => 'Stores COD payment information.',
- 'fields' => array(
- 'order_id' => array(
- 'description' => 'The {uc_orders}.order_id.',
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- 'default' => 0,
- ),
- 'delivery_month' => array(
- 'description' => 'The month of delivery. 1 => January, 2 => February, etc.',
- 'type' => 'int',
- 'size' => 'small',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- 'default' => 0,
- ),
- 'delivery_day' => array(
- 'description' => 'The day of the month of delivery.',
- 'type' => 'int',
- 'size' => 'small',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- 'default' => 0,
- ),
- 'delivery_year' => array(
- 'description' => 'The year of delivery.',
- 'type' => 'int',
- 'size' => 'small',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- 'default' => 0,
- ),
- ),
- 'primary key' => array('order_id'),
- 'foreign keys' => array(
- 'uc_orders' => array(
- 'table' => 'uc_orders',
- 'columns' => array('order_id' => 'order_id'),
- ),
- ),
- );
- $schema['uc_payment_other'] = array(
- 'description' => 'Stores Other payment type information.',
- 'fields' => array(
- 'order_id' => array(
- 'description' => 'The {uc_orders}.order_id.',
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- 'default' => 0,
- ),
- 'description' => array(
- 'description' => 'The description of the payment type.',
- 'type' => 'varchar',
- 'length' => 64,
- 'not null' => TRUE,
- 'default' => '',
- ),
- ),
- 'primary key' => array('order_id'),
- 'foreign keys' => array(
- 'uc_orders' => array(
- 'table' => 'uc_orders',
- 'columns' => array('order_id' => 'order_id'),
- ),
- ),
- );
- return $schema;
- }
- /**
- * Implements hook_uninstall().
- */
- function uc_payment_pack_uninstall() {
- db_delete('variable')
- ->condition(db_or()
- ->condition('name', 'uc_check_%', 'LIKE')
- ->condition('name', 'uc_cod_%', 'LIKE')
- )
- ->execute();
- }
- /**
- * Implements hook_update_last_removed().
- */
- function uc_payment_pack_update_last_removed() {
- return 6000;
- }
|