You are here

function user_email_verification_schema in User email verification 7

Same name and namespace in other branches
  1. 8 user_email_verification.install \user_email_verification_schema()

Implements hook_schema().

File

./user_email_verification.install, line 30
The module installation functions.

Code

function user_email_verification_schema() {
  $schema['user_email_verification'] = array(
    'description' => 'The base table for email verification for specific user.',
    'fields' => array(
      'uid' => array(
        'description' => 'The user id from users table.',
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
      ),
      'verified' => array(
        'description' => 'The verified flag.',
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
      ),
      'last_reminder' => array(
        'type' => 'int',
        'description' => 'Last notification timestamp.',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
      ),
      'reminders' => array(
        'type' => 'int',
        'description' => 'Number of reminders sent.',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
      ),
    ),
    'indexes' => array(
      'inx_uid' => array(
        'uid',
      ),
      'inx_verified' => array(
        'verified',
      ),
      'inx_last_reminder' => array(
        'last_reminder',
      ),
    ),
    'unique keys' => array(),
    'foreign keys' => array(
      'fk_verification_uid' => array(
        'table' => 'users',
        'columns' => array(
          'uid' => 'uid',
        ),
      ),
    ),
    'primary key' => array(
      'uid',
    ),
  );
  return $schema;
}