You are here

function colorized_gmap_schema in Colorized google maps block 7

Implements hook_schema().

File

./colorized_gmap.install, line 54
Contains requirements and uninstall functions for colorized_gmap.

Code

function colorized_gmap_schema() {
  $schema = array();
  $schema['colorized_gmap_units'] = array(
    'description' => 'The base table for Colorized Gmap.',
    'fields' => array(
      'id' => array(
        'description' => 'Primary Key: Identifier for a map.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'name' => array(
        'description' => 'The name of the Map - a machine name.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'created' => array(
        'description' => 'The Unix timestamp when the Map was created.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'changed' => array(
        'description' => 'The Unix timestamp when the Map was most recently saved.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'uid' => array(
        'description' => 'The {users}.uid that created this map',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'latitude' => array(
        'description' => 'Latitude position',
        'type' => 'numeric',
        'precision' => 18,
        'scale' => 12,
        'not null' => TRUE,
      ),
      'longitude' => array(
        'description' => 'Longitude position',
        'type' => 'numeric',
        'precision' => 18,
        'scale' => 12,
        'not null' => TRUE,
      ),
      'additional_settings' => array(
        'type' => 'text',
        'not null' => FALSE,
        'serialize' => TRUE,
        'description' => 'A serialized array of additional map settings.',
      ),
      'style' => array(
        'type' => 'text',
        'not null' => FALSE,
        'serialize' => TRUE,
        'description' => 'A serialized array of map stylers data.',
      ),
      'block_settings' => array(
        'type' => 'text',
        'not null' => FALSE,
        'serialize' => TRUE,
        'description' => 'Block settings.',
      ),
    ) + entity_exportable_schema_fields(),
    'primary key' => array(
      'id',
      'name',
    ),
    'indexes' => array(
      'mapcenter' => array(
        'latitude',
        'longitude',
      ),
      'mapauthor' => array(
        'name',
        'uid',
      ),
    ),
  );
  return $schema;
}