You are here

match_redirect.install in Match Redirect 7

Install, update, and uninstall functions for the redirect module.

File

match_redirect.install
View source
<?php

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

/**
 * Implements hook_schema().
 */
function match_redirect_schema() {
  $schema['match_redirect'] = array(
    'description' => 'Redirection patterns.',
    'fields' => array(
      'rid' => array(
        'type' => 'serial',
        'not null' => TRUE,
        'description' => 'primary Key: unique id.',
      ),
      'source_pattern' => array(
        'type' => 'text',
        'not null' => TRUE,
      ),
      'target' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'status_code' => array(
        'type' => 'int',
        'size' => 'small',
        'not null' => TRUE,
        'description' => 'http status code to use send.',
      ),
      'override' => array(
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'allow existing content to be redirected.',
      ),
      'query' => array(
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'allow query string to be passed with the redirect.',
      ),
      'weight' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'rid',
    ),
  );
  return $schema;
}

/**
 * Add the {match_redirect}.query field.
 */
function match_redirect_update_1() {
  $field = array(
    'type' => 'int',
    'size' => 'tiny',
    'not null' => TRUE,
    'default' => 0,
    'description' => 'allow query string to be passed with the redirect.',
  );
  db_add_field('match_redirect', 'query', $field);
}

Functions

Namesort descending Description
match_redirect_schema Implements hook_schema().
match_redirect_update_1 Add the {match_redirect}.query field.