function getlocations_fields_schema in Get Locations 7
Same name and namespace in other branches
- 7.2 modules/getlocations_fields/getlocations_fields.install \getlocations_fields_schema()
Implements hook_schema().
File
- modules/
getlocations_fields/ getlocations_fields.install, line 15 - getlocations_fields.install @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL
Code
function getlocations_fields_schema() {
$schema['getlocations_fields'] = array(
'description' => 'Locational data managed by getlocations_fields module.',
'fields' => array(
'glid' => array(
'description' => 'Primary Key: Unique location ID.',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'name' => array(
'description' => 'Place Name.',
'type' => 'varchar',
'length' => 255,
'default' => '',
'not null' => TRUE,
),
'street' => array(
'description' => 'Street address, line 1.',
'type' => 'varchar',
'length' => 255,
'default' => '',
'not null' => TRUE,
),
'additional' => array(
'description' => 'Street address, line 2.',
'type' => 'varchar',
'length' => 255,
'default' => '',
'not null' => TRUE,
),
'city' => array(
'description' => 'City.',
'type' => 'varchar',
'length' => 255,
'default' => '',
'not null' => TRUE,
),
'province' => array(
'description' => 'State / Province.',
'type' => 'varchar',
'length' => 255,
'default' => '',
'not null' => TRUE,
),
'postal_code' => array(
'description' => 'Postal / ZIP code.',
'type' => 'varchar',
'length' => 255,
'default' => '',
'not null' => TRUE,
),
'country' => array(
'description' => 'Country.',
'type' => 'varchar',
'length' => 255,
'default' => '',
'not null' => TRUE,
),
'address' => array(
'description' => 'Address.',
'type' => 'varchar',
'length' => 255,
'default' => '',
'not null' => TRUE,
),
'latitude' => array(
'description' => 'Location latitude (decimal degrees).',
'type' => 'numeric',
'precision' => 10,
'scale' => 6,
'default' => 0.0,
'not null' => TRUE,
),
'longitude' => array(
'description' => 'Location longitude (decimal degrees).',
'type' => 'numeric',
'precision' => 10,
'scale' => 6,
'default' => 0.0,
'not null' => TRUE,
),
'marker' => array(
'description' => 'Marker.',
'type' => 'varchar',
'length' => 255,
'default' => '',
'not null' => TRUE,
),
'data' => array(
'description' => 'Data.',
'type' => 'text',
'size' => 'medium',
'not null' => TRUE,
),
),
'primary key' => array(
'glid',
),
);
$schema['getlocations_fields_entities'] = array(
'description' => 'N:M join table to join getlocations_fields entries to entities, eg node, user, comments, taxonomy.',
'fields' => array(
'nid' => array(
'description' => 'Reference to {node}.nid.',
'type' => 'int',
'unsigned' => TRUE,
'default' => 0,
'not null' => TRUE,
),
'vid' => array(
'description' => 'Reference to {node_revision}.vid.',
'type' => 'int',
'unsigned' => TRUE,
'default' => 0,
'not null' => TRUE,
),
'uid' => array(
'description' => 'Reference to {users}.uid.',
'type' => 'int',
'unsigned' => TRUE,
'default' => 0,
'not null' => TRUE,
),
'tid' => array(
'description' => 'Reference to {term_data}.tid.',
'type' => 'int',
'unsigned' => TRUE,
'default' => 0,
'not null' => TRUE,
),
'cid' => array(
'description' => 'Reference to {comment}.cid.',
'type' => 'int',
'unsigned' => TRUE,
'default' => 0,
'not null' => TRUE,
),
'field_name' => array(
'description' => 'Reference to field name.',
'type' => 'varchar',
'length' => 255,
'default' => '',
'not null' => TRUE,
),
'glid' => array(
'description' => 'Reference to {getlocations_fields}.glid.',
'type' => 'int',
'unsigned' => TRUE,
'default' => 0,
'not null' => TRUE,
),
),
'indexes' => array(
'nid' => array(
'nid',
),
'vid' => array(
'vid',
),
'uid' => array(
'uid',
),
'tid' => array(
'tid',
),
'cid' => array(
'cid',
),
'field_name' => array(
'field_name',
),
'glid' => array(
'glid',
),
),
);
return $schema;
}