You are here

function uc_store_schema in Ubercart 6.2

Same name and namespace in other branches
  1. 7.3 uc_store/uc_store.install \uc_store_schema()

Implements hook_schema().

File

uc_store/uc_store.install, line 38
Install, update, and uninstall functions for the uc_store module.

Code

function uc_store_schema() {
  $schema = array();
  $schema['uc_countries'] = array(
    'description' => 'Stores country information.',
    'fields' => array(
      'country_id' => array(
        'description' => 'Primary key: numeric ISO country code.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'country_name' => array(
        'description' => 'The country name.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'country_iso_code_2' => array(
        'description' => 'The two-character ISO country code.',
        'type' => 'char',
        'length' => 2,
        'not null' => TRUE,
        'default' => '',
      ),
      'country_iso_code_3' => array(
        'description' => 'The three-character ISO country code.',
        'type' => 'char',
        'length' => 3,
        'not null' => TRUE,
        'default' => '',
      ),
      'version' => array(
        'description' => 'The version of the CIF that loaded the country information.',
        'type' => 'int',
        'size' => 'small',
        'not null' => TRUE,
        'default' => 0,
      ),
      'weight' => array(
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The list order for this country.',
      ),
    ),
    'indexes' => array(
      'country_name' => array(
        'country_name',
      ),
    ),
    'primary key' => array(
      'country_id',
    ),
  );
  $schema['uc_zones'] = array(
    'description' => 'Stores state/province information within a country.',
    'fields' => array(
      'zone_id' => array(
        'description' => 'Primary key: the unique zone id.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'zone_country_id' => array(
        'description' => 'The {uc_countries}.country_id to which this zone belongs.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'zone_code' => array(
        'description' => 'Standard abbreviation of the zone name.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'zone_name' => array(
        'description' => 'The zone name.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
    ),
    'indexes' => array(
      'zone_code' => array(
        'zone_code',
      ),
      'zone_country_id' => array(
        'zone_country_id',
      ),
    ),
    'primary key' => array(
      'zone_id',
    ),
  );
  $schema['uc_store_footers'] = array(
    'description' => 'Maps Drupal paths to Ubercart footer messages.',
    'fields' => array(
      'path_hash' => array(
        'description' => 'MD5 hash of the Drupal path.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'message' => array(
        'description' => 'The message displayed in the page footer.',
        'type' => 'text',
      ),
    ),
    'primary key' => array(
      'path_hash',
    ),
  );
  return $schema;
}