summaryrefslogtreecommitdiffstatshomepage
path: root/core/modules/ban/ban.install
blob: 28bf7492a87704eeac4f857225ad652881210f54 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php

/**
 * @file
 * Install, update and uninstall functions for the Ban module.
 */

/**
 * Implements hook_schema().
 */
function ban_schema(): array {
  $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;
}