You are here

function yr_verdata_schema in Yr Weatherdata 6

Same name and namespace in other branches
  1. 6.2 yr_verdata.install \yr_verdata_schema()
  2. 7.3 yr_verdata.install \yr_verdata_schema()
  3. 7 yr_verdata.install \yr_verdata_schema()

Implementation of hook_schema().

File

./yr_verdata.install, line 49
The install schema and hooks for yr_verdata.module.

Code

function yr_verdata_schema() {
  $schema['yr_verdata'] = array(
    'description' => 'Store locations to display forecast for on the site.',
    'fields' => array(
      'yid' => array(
        'description' => 'The unique "yr-ID".',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'url' => array(
        'description' => 'The string to append to "http://yr.no/" to create the complete url for fetching xml data.',
        'type' => 'varchar',
        'length' => 100,
        'not null' => TRUE,
        'default' => '',
      ),
      'location' => array(
        'description' => "The location's locationname, only applicable for locations in Norway.",
        'type' => 'varchar',
        'length' => 20,
        'not null' => TRUE,
        'default' => '',
      ),
      'subregion' => array(
        'description' => "The location's subregion, which is the locationname for locations outside Norway.",
        'type' => 'varchar',
        'length' => 20,
        'not null' => TRUE,
        'default' => '',
      ),
      'region' => array(
        'description' => "The location's region.",
        'type' => 'varchar',
        'length' => 20,
        'not null' => TRUE,
        'default' => '',
      ),
      'country' => array(
        'description' => "The location's country.",
        'type' => 'varchar',
        'length' => 20,
        'not null' => TRUE,
        'default' => '',
      ),
    ),
    'primary key' => array(
      'yid',
    ),
  );
  return $schema;
}