You are here

function redirect_404_schema in Redirect 8

Implements hook_schema().

File

modules/redirect_404/redirect_404.install, line 14
Update hooks for the redirect_404 module.

Code

function redirect_404_schema() {
  $schema['redirect_404'] = [
    'description' => 'Stores 404 requests.',
    'fields' => [
      'path' => [
        'description' => 'The path of the request.',
        'type' => 'varchar',
        'length' => SqlRedirectNotFoundStorage::MAX_PATH_LENGTH,
        'not null' => TRUE,
      ],
      'langcode' => [
        'description' => 'The language of this request.',
        'type' => 'varchar_ascii',
        'length' => 12,
        'not null' => TRUE,
        'default' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
      ],
      'count' => [
        'description' => 'The number of requests with that path and language.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ],
      'daily_count' => [
        'description' => 'The number of requests with that path and language in a day.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ],
      'timestamp' => [
        'description' => 'The timestamp of the last request with that path and language.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ],
      'resolved' => [
        'description' => 'Boolean indicating whether or not this path has a redirect assigned.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ],
    ],
    'primary key' => [
      'path',
      'langcode',
    ],
  ];
  return $schema;
}