restrict_ip.install in Restrict IP 8
Same filename and directory in other branches
Contains the database schema used by the restrict IP module
File
restrict_ip.installView source
<?php
/**
* @file
* Contains the database schema used by the restrict IP module
*/
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;
}
function restrict_ip_update_8001() {
\Drupal::database()
->schema()
->createTable('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',
],
],
]);
\Drupal::database()
->schema()
->createTable('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',
],
],
]);
}
Functions
Name | Description |
---|---|
restrict_ip_schema | @file Contains the database schema used by the restrict IP module |
restrict_ip_update_8001 |