You are here

function mobile_number_schema in Mobile Number 2.0.x

Same name and namespace in other branches
  1. 8 mobile_number.install \mobile_number_schema()
  2. 7 mobile_number.install \mobile_number_schema()

Implements hook_schema().

File

./mobile_number.install, line 11
Install, update and uninstall functions for the systementity_configfield module.

Code

function mobile_number_schema() {
  $schema['mobile_number_verification'] = [
    'description' => 'A table for storing verification codes for mobile numbers.',
    'fields' => [
      'token' => [
        'description' => 'Verification token.',
        'type' => 'varchar',
        'length' => 43,
        'not null' => TRUE,
      ],
      'timestamp' => [
        'description' => 'The time when the verification token was created.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ],
      'verification_code' => [
        'description' => 'Hash of the code sent to the user.',
        'type' => 'varchar',
        'length' => 40,
        'not null' => TRUE,
      ],
    ],
    'indexes' => [
      'token_created' => [
        'timestamp',
      ],
    ],
    'primary key' => [
      'token',
    ],
  ];
  return $schema;
}