You are here

getdirections_fields.install in Get Directions 7.3

getdirections_fields module installation.

File

modules/getdirections_fields/getdirections_fields.install
View source
<?php

/**
 * @file
 * getdirections_fields module installation.
 */

/**
 * Implements hook_uninstall().
 *
 */
function getdirections_fields_uninstall() {
}

/**
 * Implements hook_enable().
 *
 */
function getdirections_fields_enable() {
  drupal_set_message(st('Thank you for installing Getdirections Fields.'), 'status');
}

/**
 * Implements hook_field_schema().
 *
 * Defines the database schema of the field, using the format used by the
 * Schema API.
 *
 * All implementations of hook_field_schema() must be in the module's
 * .install file.
 *
 * @see http://drupal.org/node/146939
 * @see http://drupal.org/developing/api/schema
 */
function getdirections_fields_field_schema($field) {
  switch ($field['type']) {
    case 'getdirections_fields':
      $columns = array(
        'locative_field_name' => array(
          'type' => 'varchar',
          'length' => 255,
          'default' => '',
          'not null' => TRUE,
        ),
        'address_field_name' => array(
          'type' => 'varchar',
          'length' => 255,
          'default' => '',
          'not null' => TRUE,
        ),
      );
      break;
  }
  return array(
    'columns' => $columns,
    'indexes' => array(
      'locative_field_name' => array(
        'locative_field_name',
      ),
    ),
  );
}