You are here

function openlayers_schema in Openlayers 7.3

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

Implements hook_schema().

3 calls to openlayers_schema()
openlayers_update_7350 in ./openlayers.install
Update to the 3.x version.
openlayers_update_7360 in ./openlayers.install
Update factory_service property of each OL objects.
openlayers_update_7370 in ./openlayers.install
Update factory_service property of each OL objects to remove '.internal.'.

File

./openlayers.install, line 24
Openlayers module - installation procedure.

Code

function openlayers_schema() {
  $schema = array();

  // Maps table (ctools extras).
  $schema['openlayers_maps'] = array(
    'description' => 'Storage for User defined Openlayers maps.',
    'export' => array(
      'key' => 'machine_name',
      'key name' => 'Machine name',
      'primary key' => 'machine_name',
      'identifier' => 'ol_map',
      'default hook' => 'default_openlayers_maps',
      'cache defaults' => TRUE,
      'api' => array(
        'owner' => 'openlayers',
        'api' => 'default_openlayers_maps',
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
    'fields' => array(
      'machine_name' => array(
        'description' => 'The primary identifier for the map.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'name' => array(
        'description' => 'The title of the map.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'description' => array(
        'description' => 'The description of the map.',
        'type' => 'text',
      ),
      'factory_service' => array(
        'type' => 'text',
        'description' => 'Map service.',
      ),
      'options' => array(
        'description' => 'The serialized map.',
        'type' => 'text',
        'serialize' => TRUE,
      ),
    ),
    'primary key' => array(
      'machine_name',
    ),
    'unique keys' => array(
      'machine_name' => array(
        'machine_name',
      ),
    ),
  );

  // Layers table (ctools extras).
  $schema['openlayers_layers'] = array(
    'description' => 'Storage for user defined Openlayers layers.',
    'export' => array(
      'admin_title' => 'machine_name',
      'key' => 'machine_name',
      'key name' => 'Machine name',
      'primary key' => 'machine_name',
      'identifier' => 'ol_layer',
      'default hook' => 'default_openlayers_layers',
      'cache defaults' => TRUE,
      'api' => array(
        'owner' => 'openlayers',
        'api' => 'default_openlayers_layers',
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
    'fields' => array(
      'machine_name' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
        'description' => 'Layer system name.',
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
        'description' => 'Layer name.',
      ),
      'description' => array(
        'type' => 'text',
        'description' => 'Layer description.',
      ),
      'factory_service' => array(
        'type' => 'text',
        'description' => 'Layer service.',
      ),
      'options' => array(
        'type' => 'text',
        'description' => 'Layer options serialized.',
        'serialize' => TRUE,
      ),
    ),
    'primary key' => array(
      'machine_name',
    ),
    'unique keys' => array(
      'machine_name' => array(
        'machine_name',
      ),
    ),
  );

  // Sources table (ctools extras).
  $schema['openlayers_sources'] = array(
    'description' => 'Storage for user defined Openlayers sources.',
    'export' => array(
      'admin_title' => 'machine_name',
      'key' => 'machine_name',
      'key name' => 'Machine name',
      'primary key' => 'machine_name',
      'identifier' => 'ol_source',
      'default hook' => 'default_openlayers_sources',
      'cache defaults' => TRUE,
      'api' => array(
        'owner' => 'openlayers',
        'api' => 'default_openlayers_sources',
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
    'fields' => array(
      'machine_name' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
        'description' => 'Source system name.',
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
        'description' => 'Source name.',
      ),
      'description' => array(
        'type' => 'text',
        'description' => 'Source description.',
      ),
      'factory_service' => array(
        'type' => 'text',
        'description' => 'Service class.',
      ),
      'options' => array(
        'type' => 'text',
        'description' => 'Source options serialized.',
        'serialize' => TRUE,
      ),
    ),
    'primary key' => array(
      'machine_name',
    ),
    'unique keys' => array(
      'machine_name' => array(
        'machine_name',
      ),
    ),
  );

  // Controls table.
  $schema['openlayers_controls'] = array(
    'description' => 'Storage for user defined Openlayers controls.',
    'export' => array(
      'admin_title' => 'machine_name',
      'key' => 'machine_name',
      'key name' => 'Machine name',
      'primary key' => 'machine_name',
      'identifier' => 'ol_control',
      'default hook' => 'default_openlayers_controls',
      'cache defaults' => TRUE,
      'api' => array(
        'owner' => 'openlayers',
        'api' => 'default_openlayers_controls',
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
    'fields' => array(
      'machine_name' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
        'description' => 'Control system name.',
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
        'description' => 'Control name.',
      ),
      'description' => array(
        'type' => 'text',
        'description' => 'Control description.',
      ),
      'factory_service' => array(
        'type' => 'text',
        'description' => 'Control service.',
      ),
      'options' => array(
        'type' => 'text',
        'description' => 'Control options serialized.',
        'serialize' => TRUE,
      ),
    ),
    'primary key' => array(
      'machine_name',
    ),
    'unique keys' => array(
      'machine_name' => array(
        'machine_name',
      ),
    ),
  );

  // Interactions table.
  $schema['openlayers_interactions'] = array(
    'description' => 'Storage for user defined Openlayers interactions.',
    'export' => array(
      'admin_title' => 'machine_name',
      'key' => 'machine_name',
      'key name' => 'Machine name',
      'primary key' => 'machine_name',
      'identifier' => 'ol_interaction',
      'default hook' => 'default_openlayers_interactions',
      'cache defaults' => TRUE,
      'api' => array(
        'owner' => 'openlayers',
        'api' => 'default_openlayers_interactions',
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
    'fields' => array(
      'machine_name' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
        'description' => 'Interaction system name.',
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
        'description' => 'Interaction name.',
      ),
      'description' => array(
        'type' => 'text',
        'description' => 'Interaction description.',
      ),
      'factory_service' => array(
        'type' => 'text',
        'description' => 'Interaction service.',
      ),
      'options' => array(
        'type' => 'text',
        'description' => 'Interaction options serialized.',
        'serialize' => TRUE,
      ),
    ),
    'primary key' => array(
      'machine_name',
    ),
    'unique keys' => array(
      'machine_name' => array(
        'machine_name',
      ),
    ),
  );

  // Components table.
  $schema['openlayers_components'] = array(
    'description' => 'Storage for user defined Openlayers components.',
    'export' => array(
      'admin_title' => 'machine_name',
      'key' => 'machine_name',
      'key name' => 'Machine name',
      'primary key' => 'machine_name',
      'identifier' => 'ol_component',
      'default hook' => 'default_openlayers_components',
      'cache defaults' => TRUE,
      'api' => array(
        'owner' => 'openlayers',
        'api' => 'default_openlayers_components',
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
    'fields' => array(
      'machine_name' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
        'description' => 'Component system name.',
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
        'description' => 'Component name.',
      ),
      'description' => array(
        'type' => 'text',
        'description' => 'Component description.',
      ),
      'factory_service' => array(
        'type' => 'text',
        'description' => 'Component service.',
      ),
      'options' => array(
        'type' => 'text',
        'description' => 'Component options serialized.',
        'serialize' => TRUE,
      ),
    ),
    'primary key' => array(
      'machine_name',
    ),
    'unique keys' => array(
      'machine_name' => array(
        'machine_name',
      ),
    ),
  );

  // Projections table.
  $schema['openlayers_projections'] = array(
    'description' => 'Storage for user defined Openlayers projections.',
    'export' => array(
      'admin_title' => 'machine_name',
      'key' => 'machine_name',
      'key name' => 'Machine name',
      'primary key' => 'machine_name',
      'identifier' => 'ol_projection',
      'default hook' => 'default_openlayers_projections',
      'cache defaults' => TRUE,
      'api' => array(
        'owner' => 'openlayers',
        'api' => 'default_openlayers_projections',
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
    'fields' => array(
      'machine_name' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
        'description' => 'Projection system name.',
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
        'description' => 'Projection name.',
      ),
      'description' => array(
        'type' => 'text',
        'description' => 'Projection description.',
      ),
      'definition' => array(
        'type' => 'text',
        'description' => 'Projection options definition.',
      ),
    ),
    'primary key' => array(
      'machine_name',
    ),
    'unique keys' => array(
      'machine_name' => array(
        'machine_name',
      ),
    ),
  );

  // Styles table.
  $schema['openlayers_styles'] = array(
    'description' => 'Storage for user defined Openlayers styles.',
    'export' => array(
      'admin_title' => 'machine_name',
      'key' => 'machine_name',
      'key name' => 'Machine name',
      'primary key' => 'machine_name',
      'identifier' => 'ol_style',
      'default hook' => 'default_openlayers_styles',
      'cache defaults' => TRUE,
      'api' => array(
        'owner' => 'openlayers',
        'api' => 'default_openlayers_styles',
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
    'fields' => array(
      'machine_name' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
        'description' => 'Style system name.',
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
        'description' => 'Style name.',
      ),
      'description' => array(
        'type' => 'text',
        'description' => 'Style description.',
      ),
      'factory_service' => array(
        'type' => 'text',
        'description' => 'Style service.',
      ),
      'options' => array(
        'type' => 'text',
        'description' => 'Style options serialized.',
        'serialize' => TRUE,
      ),
    ),
    'primary key' => array(
      'machine_name',
    ),
    'unique keys' => array(
      'machine_name' => array(
        'machine_name',
      ),
    ),
  );
  return $schema;
}