You are here

simplemeta.install in Simple Meta 7.2

Same filename and directory in other branches
  1. 6.2 simplemeta.install
  2. 7 simplemeta.install

Installation and updating tasks.

File

simplemeta.install
View source
<?php

/**
 * @file
 * Installation and updating tasks.
 */

/**
 * Implements hook_install().
 */
function simplemeta_install() {
  db_update('system')
    ->fields(array(
    'weight' => 10,
  ))
    ->condition('type', 'module', '=')
    ->condition('name', 'simplemeta', '=')
    ->execute();
}

/**
 * Implements hook_schema().
 */
function simplemeta_schema() {
  $schema = array();
  $schema['simplemeta'] = array(
    'fields' => array(
      'sid' => array(
        'description' => 'The primary identifier for a Simplemeta data',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'path' => array(
        'description' => 'Primary Key: the Drupal path this entry describes',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'data' => array(
        'description' => 'serialized array of meta data',
        'type' => 'blob',
        'size' => 'big',
        'not null' => TRUE,
        'serialize' => TRUE,
      ),
      'language' => array(
        'description' => 'The language this Simplemeta data is for; blank means all languages',
        'type' => 'varchar',
        'length' => 12,
        'not null' => TRUE,
        'default' => '',
      ),
      'fit' => array(
        'description' => 'A numeric representation of how specific the path is.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'sid',
    ),
    'unique keys' => array(
      'path_language' => array(
        'path',
        'language',
      ),
    ),
  );
  $schema['cache_simplemeta'] = drupal_get_schema_unprocessed('system', 'cache');
  return $schema;
}

/**
 * Implements hook_uninstall().
 */
function simplemeta_uninstall() {
  variable_del('simplemeta_form_enable');
  variable_del('simplemeta_language_enable');
}

/**
 * Initial update for D7 version.
 */
function simplemeta_update_7000() {

  // Just update {system}.schema_version.
}

Functions

Namesort descending Description
simplemeta_install Implements hook_install().
simplemeta_schema Implements hook_schema().
simplemeta_uninstall Implements hook_uninstall().
simplemeta_update_7000 Initial update for D7 version.