Index: includes/actions.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/actions.inc,v retrieving revision 1.17 diff -u -p -r1.17 actions.inc --- includes/actions.inc 15 Sep 2008 16:07:47 -0000 1.17 +++ includes/actions.inc 23 Sep 2008 19:37:16 -0000 @@ -327,10 +327,10 @@ function actions_save($function, $type, watchdog('actions', 'Action %action saved.', array('%action' => $desc)); } else { - // aid is the callback for singleton actions so we need to keep a - // separate table for numeric aids. - db_query('INSERT INTO {actions_aid} VALUES (default)'); - $aid = db_last_insert_id('actions_aid', 'aid'); + // Get the last aid inserted and increment + $aid = variable_get('actions_last_aid', 0) + 1; + variable_set('actions_last_aid', $aid); + db_query("INSERT INTO {actions} (aid, callback, type, parameters, description) VALUES ('%s', '%s', '%s', '%s', '%s')", $aid, $function, $type, $serialized, $desc); watchdog('actions', 'Action %action created.', array('%action' => $desc)); } Index: modules/system/system.install =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.install,v retrieving revision 1.268 diff -u -p -r1.268 system.install --- modules/system/system.install 20 Sep 2008 20:22:24 -0000 1.268 +++ modules/system/system.install 23 Sep 2008 19:37:40 -0000 @@ -500,19 +500,6 @@ function system_schema() { 'primary key' => array('aid'), ); - $schema['actions_aid'] = array( - 'description' => t('Stores action IDs for non-default actions.'), - 'fields' => array( - 'aid' => array( - 'description' => t('Primary Key: Unique actions ID.'), - 'type' => 'serial', - 'unsigned' => TRUE, - 'not null' => TRUE, - ), - ), - 'primary key' => array('aid'), - ); - $schema['batch'] = array( 'description' => t('Stores details about batches (processes that run in multiple HTTP requests).'), 'fields' => array( @@ -3048,6 +3035,18 @@ function system_update_7010() { } /** + * Remove the 'actions_aid' table. + */ +function system_update_7011() { + $ret = array(); + $aid = (int) db_query("SELECT MAX(aid) FROM {actions_aid}")->fetchField(); + variable_set('actions_last_aid', $aid); + db_drop_table($ret, 'actions_aid'); + + return $ret; +} + +/** * @} End of "defgroup updates-6.x-to-7.x" * The next series of updates should start at 8000. */