sms.install in SMS Framework 6.2
Same filename and directory in other branches
Install, update and uninstall functions for the smsframework module.
File
sms.installView source
<?php
/**
* @file
* Install, update and uninstall functions for the smsframework module.
*/
/**
* Implements hook_install().
*/
function sms_install() {
drupal_install_schema('sms');
}
/**
* Implements hook_schema().
*/
function sms_schema() {
$schema['sms_carriers'] = array(
'fields' => array(
'name' => array(
'type' => 'varchar',
'not null' => TRUE,
'length' => 64,
),
'domain' => array(
'type' => 'varchar',
'not null' => TRUE,
'length' => 128,
),
),
'primary key' => array(
'domain',
),
);
return $schema;
}
/**
* Implements hook_update().
*
* Drop the now dead delta field, and change primary key to number.
*/
function sms_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;
}
/**
* Implements hook_uninstall().
*/
function sms_uninstall() {
drupal_uninstall_schema('sms');
$variables = array();
foreach ($variables as $variable) {
variable_del($variable);
}
}
Functions
Name | Description |
---|---|
sms_install | Implements hook_install(). |
sms_schema | Implements hook_schema(). |
sms_uninstall | Implements hook_uninstall(). |
sms_update_1 | Implements hook_update(). |