Skip to content
Snippets Groups Projects
Commit 6b108a3b authored by Angie Byron's avatar Angie Byron
Browse files

#773720 by scor, catch: Fixed 'Table registry doesn't exist' blocks upgrade.

parent 4ab1238c
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment