View source
<?php
function tfa_install() {
drupal_install_schema('tfa');
}
function tfa_schema() {
$schema['tfa'] = array(
'fields' => array(
'uid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => 'Primary Key: {users}.uid for user.',
),
'code' => array(
'type' => 'varchar',
'length' => 160,
'not null' => TRUE,
'default' => '',
),
'accepted' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'size' => 'tiny',
),
'created' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
),
'primary key' => array(
'uid',
),
'indexes' => array(
'code' => array(
'code',
),
),
);
return $schema;
}
function tfa_uninstall() {
drupal_uninstall_schema('tfa');
variable_del('tfa_hourly_threshold');
variable_del('tfa_send_message');
variable_del('tfa_code_length');
variable_del('tfa_channel');
variable_del('tfa_phone_field');
}