| 1 |
<?php
|
| 2 |
// $Id: sms.install,v 1.7 2008/07/30 19:42:56 diggersf Exp $
|
| 3 |
/**
|
| 4 |
* Implementation of hook_install().
|
| 5 |
*/
|
| 6 |
function sms_install() {
|
| 7 |
$result = drupal_install_schema('sms');
|
| 8 |
db_query('UPDATE {system} SET weight = -5 WHERE name = "sms_sendtophone"');
|
| 9 |
}
|
| 10 |
|
| 11 |
/**
|
| 12 |
* Implementation of hook_schema().
|
| 13 |
*/
|
| 14 |
function sms_schema() {
|
| 15 |
$schema['sms_messages'] = array(
|
| 16 |
'fields' => array(
|
| 17 |
'mid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
|
| 18 |
'sent' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
|
| 19 |
'status' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
|
| 20 |
'destination' => array('type' => 'varchar', 'not null' => TRUE, 'length' => 64),
|
| 21 |
'message' => array('type' => 'text'),
|
| 22 |
'gateway' => array('type' => 'varchar', 'not null' => TRUE, 'length' => 64),
|
| 23 |
),
|
| 24 |
'primary key' => array('mid'),
|
| 25 |
);
|
| 26 |
|
| 27 |
return $schema;
|
| 28 |
}
|
| 29 |
|
| 30 |
/**
|
| 31 |
* Implementation of hook_uninstall().
|
| 32 |
*/
|
| 33 |
function sms_uninstall() {
|
| 34 |
drupal_uninstall_schema('sms');
|
| 35 |
}
|
| 36 |
|
| 37 |
/**
|
| 38 |
* Update: Removes gateway behavior mapping
|
| 39 |
*/
|
| 40 |
function sms_update_1() {
|
| 41 |
$ret = array();
|
| 42 |
// Remove table
|
| 43 |
db_drop_table($ret, 'sms_mapping');
|
| 44 |
|
| 45 |
return $ret;
|
| 46 |
}
|