You are here

function uc_taxes_schema in Ubercart 6.2

Same name and namespace in other branches
  1. 7.3 uc_taxes/uc_taxes.install \uc_taxes_schema()

Implements hook_schema().

File

uc_taxes/uc_taxes.install, line 11
Install, update and uninstall functions for the uc_taxes module.

Code

function uc_taxes_schema() {
  $schema = array();
  $schema['uc_taxes'] = array(
    'description' => 'Stores tax information.',
    'fields' => array(
      'id' => array(
        'description' => 'Primary key: Unique tax rate id.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'name' => array(
        'description' => 'The tax rate name.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'rate' => array(
        'description' => 'The tax rate multiplier.',
        'type' => 'float',
        'not null' => TRUE,
        'default' => 0.0,
      ),
      'shippable' => array(
        'description' => 'Flag that describes how this rate applies to shippable and non-shippable products. 0 => Disregard shipability. 1 => Apply tax to shippable products only.',
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'taxed_product_types' => array(
        'description' => 'Serialized array of node types to be taxed.',
        'type' => 'text',
        'serialize' => TRUE,
      ),
      'taxed_line_items' => array(
        'description' => 'Serialized array of line item types to be taxed.',
        'type' => 'text',
        'serialize' => TRUE,
      ),
      'weight' => array(
        'description' => 'The weight of this tax rate in relation to other rates.',
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'id',
    ),
  );
  return $schema;
}