diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-04-21 07:05:44 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-04-21 07:05:44 +0000 |
commit | 6b108a3b67e8bf6151185b82f26c92d52722e560 (patch) | |
tree | 4c25a8e79b128f5d957196a0c4fac8586c065f58 | |
parent | 4ab1238ce589ae5490855b12a444ebebb6505fb5 (diff) | |
download | brdo-6b108a3b67e8bf6151185b82f26c92d52722e560.tar.gz brdo-6b108a3b67e8bf6151185b82f26c92d52722e560.tar.bz2 |
#773720 by scor, catch: Fixed 'Table registry doesn't exist' blocks upgrade.
-rw-r--r-- | includes/update.inc | 54 |
1 files changed, 29 insertions, 25 deletions
diff --git a/includes/update.inc b/includes/update.inc index e0870e27f..eeac6ea02 100644 --- a/includes/update.inc +++ b/includes/update.inc @@ -103,6 +103,35 @@ function update_prepare_d7_bootstrap() { // created yet. drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE); + // Create the registry tables. + if (!db_table_exists('registry')) { + $schema['registry'] = array( + 'fields' => array( + 'name' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'type' => array('type' => 'varchar', 'length' => 9, 'not null' => TRUE, 'default' => ''), + 'filename' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'module' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + ), + 'primary key' => array('name', 'type'), + 'indexes' => array( + 'hook' => array('type', 'weight', 'module'), + ), + ); + db_create_table('registry', $schema['registry']); + } + if (!db_table_exists('registry_file')) { + $schema['registry_file'] = array( + 'fields' => array( + 'filename' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE), + 'filectime' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'filemtime' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + ), + 'primary key' => array('filename'), + ); + db_create_table('registry_file', $schema['registry_file']); + } + // The new cache_bootstrap bin is required to bootstrap to // DRUPAL_BOOTSTRAP_SESSION, so create it here rather than in // update_fix_d7_requirements(). @@ -346,31 +375,6 @@ function update_fix_d7_requirements() { db_drop_index('semaphore', 'expire'); db_add_index('semaphore', 'value', array('value')); - // Add registry tables since these are required during an update. - $schema['registry'] = array( - 'fields' => array( - 'name' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'type' => array('type' => 'varchar', 'length' => 9, 'not null' => TRUE, 'default' => ''), - 'filename' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'module' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - ), - 'primary key' => array('name', 'type'), - 'indexes' => array( - 'hook' => array('type', 'weight', 'module'), - ), - ); - $schema['registry_file'] = array( - 'fields' => array( - 'filename' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE), - 'filectime' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'filemtime' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - ), - 'primary key' => array('filename'), - ); - db_create_table('registry', $schema['registry']); - db_create_table('registry_file', $schema['registry_file']); - $schema['date_format_type'] = array( 'description' => 'Stores configured date format types.', 'fields' => array( |