? modules/system/translations Index: modules/system/system.install =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.install,v retrieving revision 1.409 diff -u -p -r1.409 system.install --- modules/system/system.install 18 Oct 2009 12:02:40 -0000 1.409 +++ modules/system/system.install 18 Oct 2009 21:02:08 -0000 @@ -2859,13 +2859,26 @@ function system_update_7043() { * Reuse the actions_aid table as sequences. */ function system_update_7044() { - db_drop_primary_key('actions_aid'); - db_change_field('actions_aid', 'aid', 'value', array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), array('primary key' => array('value'))); - db_rename_table('actions_aid', 'sequences'); + $schema['sequences'] = array( + 'description' => 'Stores IDs.', + 'fields' => array( + 'value' => array( + 'description' => 'The value of the sequence.', + 'type' => 'serial', + 'unsigned' => TRUE, + 'not null' => TRUE, + ), + ), + 'primary key' => array('value'), + ); + db_create_table('sequences', $schema['sequences']); + $query = db_select('actions_aid')->fields('actions_aid', array('aid')); + db_insert('sequences')->fields(array('value'))->from($query)->execute(); + db_drop_table('actions_aid'); $max = db_query('SELECT MAX(value) FROM {sequences}')->fetchField(); $max_uid = db_query('SELECT MAX(uid) FROM {users}')->fetchField(); if ($max_uid > $max) { - db_update('sequences')->fields(array('value' => $max_uid))->execute(); + db_insert('sequences')->fields(array('value' => $max_uid))->execute(); } $max = db_query('SELECT MAX(value) FROM {sequences}')->fetchField(); db_delete('sequences')->condition('value', $max, '<');