You are here

function uc_payment_schema in Ubercart 6.2

Same name and namespace in other branches
  1. 7.3 payment/uc_payment/uc_payment.install \uc_payment_schema()

@file Install hooks for uc_payment.module.

File

payment/uc_payment/uc_payment.install, line 8
Install hooks for uc_payment.module.

Code

function uc_payment_schema() {
  $schema = array();
  $schema['uc_payment_receipts'] = array(
    'description' => 'Stores completed payments.',
    'fields' => array(
      'receipt_id' => array(
        'description' => 'Primary key: the payment receipt 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,
      ),
      'method' => array(
        'description' => 'The payment method.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'amount' => array(
        'description' => 'The payment amount in the store default currency.',
        'type' => 'numeric',
        'precision' => 16,
        'scale' => 5,
        'not null' => TRUE,
        'default' => 0,
      ),
      'uid' => array(
        'description' => 'The {users}.uid who collected the payment.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'data' => array(
        'description' => 'A serialized array of extra payment data.',
        'type' => 'text',
        'serialize' => TRUE,
      ),
      'comment' => array(
        'description' => 'A comment made on the payment.',
        'type' => 'text',
      ),
      'received' => array(
        'description' => 'The Unix timestamp indicating when the payment was received.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'indexes' => array(
      'order_id' => array(
        'order_id',
      ),
    ),
    'primary key' => array(
      'receipt_id',
    ),
  );
  return $schema;
}