You are here

function openlayers_schema in Openlayers 6

Same name and namespace in other branches
  1. 6.2 openlayers.install \openlayers_schema()
  2. 7.3 openlayers.install \openlayers_schema()
  3. 7.2 openlayers.install \openlayers_schema()

Implementation of hook_schema().

File

./openlayers.install, line 49
This file holds the functions for the installing and enabling of the openlayers module.

Code

function openlayers_schema() {
  $schema['openlayers_map_presets'] = array(
    'fields' => array(
      'preset_id' => array(
        'description' => t('The primary identifier for an OpenLayers preset.'),
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'preset_name' => array(
        'description' => t('The primary identifier for the preset.'),
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'preset_title' => array(
        'description' => t('The title of the preset.'),
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'preset_description' => array(
        'description' => t('The description of the preset.'),
        'type' => 'text',
        'not null' => TRUE,
      ),
      'preset_data' => array(
        'description' => t('The serialized map.'),
        'type' => 'text',
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'preset_id',
    ),
    'unique key' => array(
      'preset_name',
    ),
  );
  return $schema;
}