You are here

function login_security_schema in Login Security 6

Same name and namespace in other branches
  1. 8 login_security.install \login_security_schema()
  2. 7 login_security.install \login_security_schema()
  3. 2.x login_security.install \login_security_schema()

Implementation of hook_schema().

File

./login_security.install, line 11
Login Security installation routines

Code

function login_security_schema() {
  $schema['login_security_track'] = array(
    'description' => t('Keeps track of failed login attempts, as a pair of the IP address and user name.'),
    'fields' => array(
      'id' => array(
        'type' => 'serial',
        'not null' => TRUE,
        'description' => t("ID of each login event."),
      ),
      'host' => array(
        'type' => 'varchar',
        'length' => 39,
        'not null' => TRUE,
        'default' => '',
        'description' => t("The IP address of the request."),
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
        'default' => '',
        'description' => t("Clean username, submitted using the login form."),
      ),
      'timestamp' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => t("Timestamp of the event."),
      ),
    ),
    'indexes' => array(
      'name' => array(
        'name',
      ),
      'host' => array(
        'host',
      ),
      'timestamp' => array(
        'timestamp',
      ),
    ),
    'primary key' => array(
      'id',
    ),
  );
  return $schema;
}