You are here

function uc_stripe_schema in Ubercart Stripe 7

Same name and namespace in other branches
  1. 6 uc_stripe.install \uc_stripe_schema()
  2. 7.3 uc_stripe.install \uc_stripe_schema()

Implements hook_schema().

File

./uc_stripe.install, line 41
Installation file for the uc_stripe module.

Code

function uc_stripe_schema() {
  $schema = array();
  $schema['uc_recurring_stripe'] = array(
    'description' => 'Stores customer ids and plan names for Stripe subscriptions.',
    'fields' => array(
      'rfid' => array(
        'description' => 'The recurring fee id.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'active' => array(
        'description' => 'Whether or not this subscription is currently active.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'uid' => array(
        'description' => 'The uid of this user.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'order_id' => array(
        'description' => 'The order_id of the purchase.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'nid' => array(
        'description' => 'The nid of this subscription product.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'customer_id' => array(
        'description' => 'The Stripe customer id.',
        'type' => 'varchar',
        'length' => 50,
        'not null' => TRUE,
        'default' => '',
      ),
      'plan_id' => array(
        'description' => 'The corresponding plan id.',
        'type' => 'varchar',
        'length' => 50,
        'not null' => TRUE,
        'default' => '',
      ),
    ),
    'primary key' => array(
      'rfid',
    ),
  );
  return $schema;
}