You are here

function restrict_ip_schema in Restrict IP 8

Same name and namespace in other branches
  1. 8.2 restrict_ip.install \restrict_ip_schema()
  2. 3.x restrict_ip.install \restrict_ip_schema()

@file Contains the database schema used by the restrict IP module

File

./restrict_ip.install, line 7
Contains the database schema used by the restrict IP module

Code

function restrict_ip_schema() {
  $schema['restrict_ip_whitelisted_ip_addresses'] = [
    'description' => 'Stores IP addresses whitelisted in the Restrict IP module',
    'fields' => [
      'ip_address' => [
        'description' => 'A Whitelisted IP address',
        'type' => 'varchar',
        'length' => 255,
      ],
    ],
    'indexes' => [
      'ip_address' => [
        'ip_address',
      ],
    ],
  ];
  $schema['restrict_ip_paths'] = [
    'description' => 'Stores white and black listed paths for the Restrict IP module',
    'fields' => [
      'type' => [
        'description' => 'The type of the listing, either black or white',
        'type' => 'varchar',
        'length' => 5,
      ],
      'path' => [
        'description' => 'The path to be white/blacklisted',
        'type' => 'varchar',
        'length' => 255,
      ],
    ],
    'indexes' => [
      'type-path' => [
        'type',
        'path',
      ],
    ],
  ];
  return $schema;
}