ban.install 708 B

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