You are here

views_natural_sort.install in Views Natural Sort 8.2

Install file for the Views Natural Sort Module.

File

views_natural_sort.install
View source
<?php

/**
 * @file
 * Install file for the Views Natural Sort Module.
 */

/**
 * Implements hook_schema().
 */
function views_natural_sort_schema() {
  $schema['views_natural_sort'] = [
    'description' => 'Compressed titles for natural sorting.',
    'fields' => [
      'eid' => [
        'description' => 'Entity id',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ],
      'entity_type' => [
        'description' => 'Entity Type',
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'default' => 'node',
      ],
      'field' => [
        'description' => 'The field name. This will be title or some cck text field, etc.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ],
      'delta' => [
        'description' => 'The sequence number for this data item, used for multi-value fields',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ],
      'content' => [
        'description' => 'Filtered content used for sorting.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ],
    ],
    'primary key' => [
      'eid',
      'entity_type',
      'field',
      'delta',
    ],
  ];
  return $schema;
}

/**
 * Implements hook_install().
 */
function views_natural_sort_install() {
  views_natural_sort_queue_data_for_rebuild();
}

/**
 * Implements hook_uninstall().
 */
function views_natural_sort_uninstall() {

  // Remove states and stuff.
}