You are here

function views_natural_sort_schema in Views Natural Sort 8.2

Same name and namespace in other branches
  1. 6 views_natural_sort.install \views_natural_sort_schema()
  2. 7.2 views_natural_sort.install \views_natural_sort_schema()
  3. 7 views_natural_sort.install \views_natural_sort_schema()

Implements hook_schema().

File

./views_natural_sort.install, line 11
Install file for the Views Natural Sort Module.

Code

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;
}