View source
<?php
function sms_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
$success = TRUE;
db_query('
CREATE TABLE {sms_messages} (
mid int(10) NOT NULL,
sent int(11) NOT NULL,
status int(11) NOT NULL,
destination varchar(64) NOT NULL,
message text default NULL,
gateway varchar(64) NOT NULL,
PRIMARY KEY (mid)) /*!40100 DEFAULT CHARACTER SET utf8 */;
');
db_query('UPDATE {system} SET weight = -5 WHERE name = "sms_sendtophone"');
break;
}
if ($success) {
drupal_set_message(t('SMS Framework installed succesfully.'));
}
else {
drupal_set_message(t('SMS Framework installation failed. Database tables must be created manually.', 'error'));
}
}
function sms_uninstall() {
db_query('DROP TABLE {sms_messages}');
drupal_set_message(t('SMS Framework uninstalled successfully.'));
}
function sms_update_1() {
$ret = array();
$ret[] = update_sql("DROP TABLE {sms_mapping}");
return $ret;
}