Commit 2ed2c5f9 authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

#173982 by pwolanin and chx: fix schema inconsistencies between a fresh Drupal...

#173982 by pwolanin and chx: fix schema inconsistencies between a fresh Drupal 6 install and a Drupal 5 upgraded to Drupal 6
parent f82029a2
......@@ -2956,7 +2956,7 @@ function system_update_6009() {
*/
function system_update_6010() {
$ret = array();
db_add_field($ret, 'watchdog', 'variables', array('type' => 'text', 'size' => 'medium', 'not null' => TRUE, 'initial' => 'N;'));
db_add_field($ret, 'watchdog', 'variables', array('type' => 'text', 'size' => 'big', 'not null' => TRUE, 'initial' => 'N;'));
return $ret;
}
......@@ -3508,6 +3508,7 @@ function system_update_6021() {
$ret[] = update_sql("UPDATE {blocks_roles} SET delta = '". $menu_name ."' WHERE module = 'menu' AND delta = '". $mid ."'");
}
$ret[] = array('success' => TRUE, 'query' => t('Relocated @num existing items to the new menu system.', array('@num' => $_SESSION['system_update_6021'])));
$ret[] = update_sql("DROP TABLE {menu}");
unset($_SESSION['system_update_6021'], $_SESSION['system_update_6021_max'], $_SESSION['menu_menu_map'], $_SESSION['menu_item_map'], $_SESSION['menu_bogus_menus']);
// Create the menu overview links - also calls menu_rebuild().
module_invoke('menu', 'enable');
......@@ -3569,12 +3570,6 @@ function system_update_6022() {
function system_update_6023() {
$ret = array();
// vid is NULL
db_drop_unique_key($ret, 'node', 'nid_vid');
db_drop_unique_key($ret, 'node', 'vid');
db_change_field($ret, 'node', 'vid', 'vid', array('type' => 'int', 'unsigned' => TRUE, 'default' => 0));
db_add_unique_key($ret, 'node', 'nid_vid', array('nid', 'vid'));
db_add_unique_key($ret, 'node', 'vid', array('vid'));
// nid is DEFAULT 0
db_drop_index($ret, 'node_revisions', 'nid');
......@@ -3758,6 +3753,18 @@ function system_update_6031() {
return array();
}
/**
* profile_fields.name used to be nullable but is part of a unique key
* and so shouldn't be.
*/
function system_update_6032() {
$ret = array();
db_drop_unique_key($ret, 'profile_fields', 'name');
db_change_field($ret, 'profile_fields', 'name', 'name', array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''));
db_add_unique_key($ret, 'profile_fields', 'name', array('name'));
return $ret;
}
/**
* @} End of "defgroup updates-5.x-to-6.x"
* The next series of updates should start at 7000.
......
......@@ -163,14 +163,6 @@ function system_schema() {
'primary key' => array('mlid'),
);
$schema['sequences'] = array(
'fields' => array(
'name' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
'id' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0)
),
'primary key' => array('name'),
);
$schema['sessions'] = array(
'fields' => array(
'uid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment