PHP 7
Ban.install Guest on 20th November 2020 05:26:46 AM
  1. <?php
  2.  
  3. /**
  4.  * @file
  5.  * Install, update and uninstall functions for the Ban module.
  6.  */
  7.  
  8. /**
  9.  * Implements hook_schema().
  10.  */
  11. function ban_schema() {
  12.   $schema['ban_ip'] = [
  13.     'description' => 'Stores banned IP addresses.',
  14.     'fields' => [
  15.       'iid' => [
  16.         'description' => 'Primary Key: unique ID for IP addresses.',
  17.         'type' => 'serial',
  18.         'unsigned' => TRUE,
  19.         'not null' => TRUE,
  20.       ],
  21.       'ip' => [
  22.         'description' => 'IP address',
  23.         'type' => 'varchar_ascii',
  24.         'length' => 40,
  25.         'not null' => TRUE,
  26.         'default' => '',
  27.       ],
  28.     ],
  29.     'indexes' => [
  30.       'ip' => ['ip'],
  31.     ],
  32.     'primary key' => ['iid'],
  33.   ];
  34.   return $schema;
  35. }

Paste is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Recent Pastes

Raw Paste

Login or Register to edit or fork this paste. It's free.