simple_sitemap_views.install 1.68 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
<?php

/**
 * @file
 * Install and uninstall hooks for the simple_sitemap_views module.
 */

/**
 * Implements hook_uninstall().
 */
function simple_sitemap_views_uninstall() {
  // Disable views display extender plugin.
  \Drupal::service('simple_sitemap.views')->disable();
}

/**
 * Implements hook_schema().
 */
function simple_sitemap_views_schema() {
  $schema['simple_sitemap_views'] = [
    'description' => 'Index of argument values for view pages.',
    'fields' => [
      'id' => [
        'type' => 'serial',
        'not null' => TRUE,
        'description' => 'Primary Key: Unique ID for argument values.',
      ],
      'view_id' => [
        'type' => 'varchar_ascii',
        'not null' => TRUE,
        'default' => '',
        'length' => 128,
        'description' => 'The ID of the view.',
      ],
      'display_id' => [
        'type' => 'varchar_ascii',
        'not null' => TRUE,
        'default' => '',
        'length' => 128,
        'description' => 'The ID of the view display.',
      ],
      'arguments_ids' => [
        'type' => 'varchar',
        'not null' => TRUE,
        'default' => '',
        'length' => 1024,
        'description' => 'A string representation of the set of argument identifiers.',
      ],
      'arguments_values' => [
        'type' => 'varchar',
        'not null' => TRUE,
        'default' => '',
        'length' => 1024,
        'description' => 'A string representation of the set of argument values.',
      ],
    ],
    'primary key' => ['id'],
    'indexes' => [
      'view' => ['view_id'],
      'display' => ['view_id', 'display_id'],
      'arguments_ids' => ['view_id', 'display_id', 'arguments_ids'],
    ],
  ];
  return $schema;
}