1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <?php
- /**
- * @file
- * Install, update and uninstall functions for the uc_coupon_purchase module.
- *
- */
- /**
- * Implements hook_schema()
- */
- function uc_coupon_purchase_schema() {
- $schema = array();
- $schema['uc_coupon_purchase'] = array(
- 'description' => 'Ubercart Purchased Coupons',
- 'fields' => array(
- 'pfid' => array(
- 'description' => 'The product feature id.',
- 'type' => 'serial',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- ),
- 'nid' => array(
- 'description' => 'The identifier of the node that has a feature.',
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- 'default' => 0,
- ),
- 'model' => array(
- 'description' => 'The SKU of the product that has a feature.',
- 'type' => 'varchar',
- 'length' => 30,
- 'not null' => TRUE,
- 'default' => '',
- ),
- 'base_cid' => array(
- 'description' => 'The base coupon ID to use when purchasing this feature.',
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- 'default' => 0,
- ),
- ),
- 'indexes' => array(
- 'nid' => array('nid'),
- 'model' => array('model'),
- ),
- 'primary key' => array('pfid'),
- );
- $schema['uc_coupon_purchase_users'] = array(
- 'description' => 'Ubercart Purchased Coupons Per Purchaser',
- 'fields' => array(
- 'cpuid' => array(
- 'type' => 'serial',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- ),
- 'uid' => array(
- 'description' => 'The user id.',
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- ),
- 'cid' => array(
- 'description' => 'The coupon id.',
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- ),
- ),
- 'primary key' => array('cpuid'),
- );
- return $schema;
- }
- /**
- * Implements hook_uninstall().
- */
- function uc_coupon_purchase_uninstall() {
- variable_del('uc_coupon_purchase_order_status');
- }
- /**
- * Implements hook_update_last_removed().
- */
- function uc_coupon_purchase_update_last_removed() {
- return 6000;
- }
|