function ban_schema

Same name in other branches
  1. 9 core/modules/ban/ban.install \ban_schema()
  2. 8.9.x core/modules/ban/ban.install \ban_schema()
  3. 11.x core/modules/ban/ban.install \ban_schema()

Implements hook_schema().

File

core/modules/ban/ban.install, line 11

Code

function ban_schema() {
    $schema['ban_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',
                'type' => 'varchar_ascii',
                'length' => 40,
                'not null' => TRUE,
                'default' => '',
            ],
        ],
        'indexes' => [
            'ip' => [
                'ip',
            ],
        ],
        'primary key' => [
            'iid',
        ],
    ];
    return $schema;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.