You are here

function security_questions_schema in Security Questions 7

Same name and namespace in other branches
  1. 6.2 security_questions.install \security_questions_schema()
  2. 6 security_questions.install \security_questions_schema()
  3. 7.2 security_questions.install \security_questions_schema()

Implements hook_schema().

File

./security_questions.install, line 10
Install file for security_questions.

Code

function security_questions_schema() {
  $schema = array();
  $schema['security_questions_answers'] = array(
    'description' => 'Contains users security question answers.',
    'fields' => array(
      'uid' => array(
        'description' => 'The user ID.',
        'type' => 'int',
        'not null' => TRUE,
      ),
      'security_question_id' => array(
        'description' => 'The security question ID',
        'type' => 'int',
      ),
      'user_answer' => array(
        'description' => 'The answer to the users question',
        'type' => 'varchar',
        'length' => '100',
      ),
    ),
    'primary key' => array(
      'uid',
      'security_question_id',
    ),
  );
  $schema['security_questions'] = array(
    'description' => 'Contains possible security questions',
    'fields' => array(
      'security_question_id' => array(
        'description' => 'The security question ID',
        'type' => 'serial',
      ),
      'security_question' => array(
        'description' => 'The text of the question',
        'type' => 'varchar',
        'length' => '500',
      ),
      'uid' => array(
        'description' => 'The user ID who created the question.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 1,
      ),
      'admin' => array(
        'description' => 'Admin created or not?.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'security_question_id',
    ),
  );
  return $schema;
}