? gateway_hslsms_soap.inc ? hslsms.inc ? smsgateway_add_uids_to_logs.patch ? smsgateway_no_auto_increment.patch Index: smsgateway.install =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/smsgateway/smsgateway.install,v retrieving revision 1.2 diff -u -p -r1.2 smsgateway.install --- smsgateway.install 17 Oct 2006 22:00:31 -0000 1.2 +++ smsgateway.install 10 Mar 2007 16:38:13 -0000 @@ -7,7 +7,7 @@ function smsgateway_install() case 'mysqli': $ret1 = db_query(' CREATE TABLE {smslog} ( - sid int(10) NOT NULL auto_increment, + sid int(10) NOT NULL, direction varchar(3) NOT NULL, number varchar(20) NOT NULL, message text default NULL, @@ -45,4 +45,15 @@ function smsgateway_update_1() { return _system_update_utf8( array('smslog')); } +function smsgateway_update_2() { + $name = db_prefix_tables('smslog'); + $res = db_fetch_object(db_query('SELECT max(sid) as sid FROM {smslog}')); + $id = $res->sid; + + db_query('LOCK TABLES {sequences} WRITE'); + db_query("REPLACE INTO {sequences} VALUES ('%s', %d)", $name, $id); + db_query('UNLOCK TABLES'); + + return array(update_sql('ALTER TABLE {smslog} CHANGE sid sid int(10) NOT NULL')); +} ?> \ No newline at end of file Index: smsgateway.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/smsgateway/smsgateway.module,v retrieving revision 1.4.2.1 diff -u -p -r1.4.2.1 smsgateway.module --- smsgateway.module 18 Dec 2006 22:27:38 -0000 1.4.2.1 +++ smsgateway.module 10 Mar 2007 16:38:14 -0000 @@ -93,7 +93,8 @@ function smsgateway_menu() { * the response received from the gateway. */ function _smsgateway_smslog($destination, $message, $response, $incoming = false) { - db_query('INSERT INTO {smslog} (direction, number, message, response, timestamp) VALUES ( \'%s\', \'%s\', \'%s\', \'%s\', \'%d\')', $incoming ? 'IN' : 'OUT', $destination, $message, $response, time()); + $id = db_next_id('smslog'); + db_query('INSERT INTO {smslog} (sid, direction, number, message, response, timestamp) VALUES (%d, \'%s\', \'%s\', \'%s\', \'%s\', %d)', $id, ($incoming ? 'IN' : 'OUT'), $destination, $message, $response, time()); } /**