You are here

function gm3_region_schema in Google Maps API V3 7

Implementation of hook_schema().

File

gm3_region/gm3_region.install, line 72

Code

function gm3_region_schema() {
  return array(
    'cache_gm3_polygon' => drupal_get_schema_unprocessed('system', 'cache'),
    'gm3_region_data' => array(
      'description' => 'Stores the Polygon data for TDWG4 Regions',
      'fields' => array(
        'name' => array(
          'description' => "Level name",
          'type' => 'varchar',
          'not null' => TRUE,
          'length' => 64,
        ),
        'continent' => array(
          'description' => "Continent",
          'type' => 'varchar',
          'length' => 20,
          'default' => '',
        ),
        'iso_code' => array(
          'description' => "ISO Code",
          'type' => 'varchar',
          'length' => 2,
          'default' => '',
        ),
        'level_4_code' => array(
          'description' => "Level 4 code",
          'type' => 'varchar',
          'length' => 2,
          'not null' => TRUE,
          'default' => '',
        ),
        'level_3_code' => array(
          'description' => "Level 3 code",
          'type' => 'varchar',
          'length' => 3,
          'not null' => TRUE,
          'default' => '',
        ),
        'level_2_code' => array(
          'description' => "Level 2 id",
          'type' => 'int',
          'size' => 'tiny',
          'not null' => TRUE,
          'default' => 0,
        ),
        'level_1_code' => array(
          'description' => "Level 1 id",
          'type' => 'int',
          'not null' => TRUE,
          'size' => 'tiny',
          'default' => 0,
        ),
        'polygons' => array(
          'description' => "Polygons",
          'type' => 'text',
          'not null' => TRUE,
          'size' => 'medium',
        ),
        'mysql_polygons' => array(
          'description' => 'MySQL GEO extension',
          'mysql_type' => 'MULTIPOLYGON',
        ),
      ),
      'primary key' => array(
        'level_4_code',
        'level_3_code',
        'level_2_code',
        'level_1_code',
      ),
    ),
  );
}