advban.install in Advanced ban 8
Install, update and uninstall functions for the Advban module.
File
advban.installView source
<?php
/**
* @file
* Install, update and uninstall functions for the Advban module.
*/
/**
* Implements hook_schema().
*/
function advban_schema() {
$schema['advban_ip'] = [
'description' => 'Stores banned IP addresses.',
'fields' => [
'iid' => [
'description' => 'Primary Key: unique ID for IP addresses.',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
],
'ip' => [
'description' => 'IP address (or begin, if range)',
'type' => 'varchar_ascii',
'length' => 40,
'not null' => TRUE,
'default' => '',
],
'ip_end' => [
'description' => 'IP address (end, if range)',
'type' => 'varchar_ascii',
'length' => 40,
'not null' => TRUE,
'default' => '',
],
'expiry_date' => [
'description' => 'Timestamp for when this IP address can be unblocked.',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
],
],
'indexes' => [
'ip' => [
'ip',
],
],
'primary key' => [
'iid',
],
];
return $schema;
}
Functions
Name | Description |
---|---|
advban_schema | Implements hook_schema(). |