View source
<?php
function sms_user_install() {
drupal_install_schema('sms_user');
}
function sms_user_schema() {
$schema['sms_user'] = array(
'fields' => array(
'uid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'number' => array(
'type' => 'varchar',
'not null' => TRUE,
'length' => 32,
),
'status' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'code' => array(
'type' => 'varchar',
'not null' => TRUE,
'length' => 16,
),
'gateway' => array(
'type' => 'text',
),
),
'primary key' => array(
'number',
),
'indexes' => array(
'uid' => array(
'uid',
),
),
);
return $schema;
}
function sms_user_update_1() {
$ret = array();
db_drop_primary_key($ret, 'sms_user');
db_add_primary_key($ret, 'sms_user', array(
'number',
));
db_add_index($ret, 'sms_user', 'uid', array(
'uid',
));
db_drop_field($ret, 'sms_user', 'delta');
return $ret;
}
function sms_user_uninstall() {
drupal_uninstall_schema('sms_user');
$variables = array(
'sms_user_registration_enabled',
'sms_user_allow_password',
'sms_user_new_account_message',
);
foreach ($variables as $variable) {
variable_del($variable);
}
}