You are here

field_sql_norevisions.install in Field SQL norevisions 7

Same filename and directory in other branches
  1. 7.2 field_sql_norevisions.install

Install, update and uninstall functions for the field_sql_norevision module.

File

field_sql_norevisions.install
View source
<?php

/**
 * @file
 * Install, update and uninstall functions for the field_sql_norevision module.
 */

/**
 * Implements hook_install().
 */
function field_sql_norevisions_install() {
  variable_set('field_storage_default', 'field_sql_norevisions');

  // If the module is enabled after the first call to _field_info_collate_types
  // the functions static cache will be need to be reset.
  _field_info_collate_types(TRUE);
}

/**
 * Implements hook_schema().
 */
function field_sql_norevisions_schema() {
  $schema = array();

  // Dynamic (data) tables.
  if (db_table_exists('field_config')) {
    $fields = field_read_fields(array(), array(
      'include_deleted' => TRUE,
      'include_inactive' => TRUE,
    ));
    drupal_load('module', 'field_sql_norevisions');
    foreach ($fields as $field) {
      if ($field['storage']['type'] == 'field_sql_norevisions') {
        $schema += _field_sql_norevisions_schema($field);
      }
    }
  }
  return $schema;
}

/**
 * Implements hook_install().
 */
function field_sql_norevisions_uninstall() {
  variable_del('field_storage_default');
}