You are here

function regions_api_schema in Country codes API 6

Implementation of hook_schema().

File

contrib/regions_api/regions_api.install, line 11
Install file for Regions API.

Code

function regions_api_schema() {
  $schema['regions_api_regions'] = array(
    'description' => 'Mapping of continent codes to country codes.',
    'fields' => array(
      'rid' => array(
        'type' => 'serial',
        'not null' => TRUE,
        'description' => 'Primary Key: Unique region ID.',
      ),
      'iso2' => array(
        'description' => 'ISO 3166 alpha-2 country code.',
        'type' => 'char',
        'length' => 2,
        'not null' => TRUE,
      ),
      'name' => array(
        'description' => 'Region name',
        'type' => 'varchar',
        'length' => 80,
        'not null' => TRUE,
      ),
      'abbreviation' => array(
        'description' => 'Region abbreviation',
        'type' => 'varchar',
        'length' => 5,
        'not null' => FALSE,
      ),
    ),
    'primary key' => array(
      'rid',
    ),
  );
  return $schema;
}