123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- <?php
- /**
- * @file
- * Install, update and uninstall functions for the uc_weightquote module.
- */
- /**
- * Implements hook_schema().
- */
- function uc_weightquote_schema() {
- $schema = array();
- $schema['uc_weightquote_products'] = array(
- 'description' => 'Stores product information about weight-based shipping quotes.',
- 'fields' => array(
- 'vid' => array(
- 'description' => 'The {uc_products}.vid.',
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- 'default' => 0,
- ),
- 'nid' => array(
- 'description' => 'The {uc_products}.nid.',
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- 'default' => 0,
- ),
- 'mid' => array(
- 'description' => 'The {uc_weightquote_methods}.mid.',
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- 'default' => 0,
- ),
- 'rate' => array(
- 'description' => 'The rate multiplier for this product, in the store default currency, per the product weight in store default weight units.',
- 'type' => 'numeric',
- 'precision' => 16,
- 'scale' => 5,
- 'not null' => FALSE,
- ),
- ),
- 'primary key' => array('vid', 'mid'),
- 'foreign keys' => array(
- 'uc_products' => array(
- 'table' => 'uc_products',
- 'columns' => array(
- 'nid' => 'nid',
- 'vid' => 'vid',
- ),
- ),
- 'uc_weightquote_methods' => array(
- 'table' => 'uc_weightquote_methods',
- 'columns' => array('mid' => 'mid'),
- ),
- ),
- );
- $schema['uc_weightquote_methods'] = array(
- 'description' => 'Stores weight-based shipping quote methods information.',
- 'fields' => array(
- 'mid' => array(
- 'description' => 'Primary key: The shipping quote method ID.',
- 'type' => 'serial',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- ),
- 'title' => array(
- 'description' => 'The method title, displayed on administration pages.',
- 'type' => 'varchar',
- 'length' => 255,
- 'not null' => TRUE,
- 'default' => '',
- ),
- 'label' => array(
- 'description' => 'The user-facing label of the shipping method.',
- 'type' => 'varchar',
- 'length' => 255,
- 'not null' => TRUE,
- 'default' => '',
- ),
- 'base_rate' => array(
- 'description' => 'The amount of shipping cost before product weight is applied.',
- 'type' => 'numeric',
- 'precision' => 16,
- 'scale' => 5,
- 'not null' => TRUE,
- 'default' => 0.0,
- ),
- 'product_rate' => array(
- 'description' => 'The default rate multiplier, in the store default currency, per the product weight in store default weight units.',
- 'type' => 'numeric',
- 'precision' => 16,
- 'scale' => 5,
- 'not null' => TRUE,
- 'default' => 0.0,
- ),
- ),
- 'primary key' => array('mid'),
- );
- return $schema;
- }
|