You are here

views_url_alias_node.install in Views URL alias 8

Same filename and directory in other branches
  1. 6 views_url_alias_node.install
  2. 7 views_url_alias_node.install

Installation information for the Views URL alias (node) module.

File

views_url_alias_node.install
View source
<?php

/**
 * @file
 * Installation information for the Views URL alias (node) module.
 */

/**
 * Implements hook_install().
 */
function views_url_alias_node_install() {

  // Set the weight to 2 so that this module executes after pathauto.
  module_set_weight('views_url_alias_node', 2);
  module_load_include('module', 'views_url_alias_node');
  views_url_alias_node_rebuild();
}

/**
 * Implements hook_schema().
 */
function views_url_alias_node_schema() {
  return array(
    'views_url_alias_node' => array(
      'description' => t("A second url alias table for only node aliases used by views."),
      'fields' => array(
        'nid' => array(
          'description' => 'The related {node}.nid for the url alias.',
          'type' => 'int',
          'not null' => TRUE,
          'default' => 0,
        ),
        'alias' => array(
          'description' => 'The alias for this path; e.g. title-of-the-story.',
          'type' => 'varchar',
          'length' => 255,
          'not null' => TRUE,
          'default' => '',
        ),
      ),
      'index' => array(
        'nid' => array(
          'nid',
        ),
        'nid_alias' => array(
          'nid',
          'alias',
        ),
      ),
      'foreign keys' => array(
        'nid' => array(
          'table' => 'node',
          'columns' => array(
            'nid' => 'nid',
          ),
        ),
      ),
    ),
  );
}

Functions