You are here

function honeypot_schema in Honeypot 7

Same name and namespace in other branches
  1. 8 honeypot.install \honeypot_schema()
  2. 6 honeypot.install \honeypot_schema()
  3. 2.0.x honeypot.install \honeypot_schema()

Implements hook_schema().

1 call to honeypot_schema()
honeypot_update_7100 in ./honeypot.install
Adds the 'hostname' column to the {honeypot_user} table.

File

./honeypot.install, line 11
Install, update and uninstall functions for the Honeypot module.

Code

function honeypot_schema() {
  $schema['honeypot_user'] = array(
    'description' => 'Table that stores failed attempts to submit a form.',
    'fields' => array(
      'uid' => array(
        'description' => 'Foreign key to {users}.uid; uniquely identifies a Drupal user to whom this ACL data applies.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'hostname' => array(
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'description' => 'Hostname of user that that triggered honeypot.',
      ),
      'timestamp' => array(
        'description' => 'Date/time when the form submission failed, as Unix timestamp.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
    ),
    'indexes' => array(
      'uid' => array(
        'uid',
      ),
      'timestamp' => array(
        'timestamp',
      ),
    ),
  );
  return $schema;
}