summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-01-09 02:51:09 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-01-09 02:51:09 +0000
commit1f6a553cd2f8eeb531e6404d793797cb19bcfaf4 (patch)
treed6202498a9abe607b3d7252a0a9ce99c9318ea76 /includes
parent25747314e2b923f90f44e69c896d3aa0e0087dce (diff)
downloadbrdo-1f6a553cd2f8eeb531e6404d793797cb19bcfaf4.tar.gz
brdo-1f6a553cd2f8eeb531e6404d793797cb19bcfaf4.tar.bz2
#629794 follow-up by yched: Fixed batch API in update.php.
Diffstat (limited to 'includes')
-rw-r--r--includes/update.inc21
1 files changed, 21 insertions, 0 deletions
diff --git a/includes/update.inc b/includes/update.inc
index 816f32bd0..28b4cbb81 100644
--- a/includes/update.inc
+++ b/includes/update.inc
@@ -383,6 +383,27 @@ function update_fix_d7_requirements() {
);
db_create_table('queue', $schema['queue']);
+ // Create the sequences table.
+ $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']);
+ // Initialize the table with the maximum current increment of the tables
+ // that will rely on it for their ids.
+ $max_aid = db_query('SELECT MAX(aid) FROM {actions_aid}')->fetchField();
+ $max_uid = db_query('SELECT MAX(uid) FROM {users}')->fetchField();
+ $max_batch_id = db_query('SELECT MAX(bid) FROM {batch}')->fetchField();
+ db_insert('sequences')->fields(array('value' => max($max_aid, $max_uid, $max_batch_id)))->execute();
+
// Add column for locale context.
if (db_table_exists('locales_source')) {
db_add_field('locales_source', 'context', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '', 'description' => 'The context this string applies to.'));