From 42f321d0edb8f6c38c83e5cb0baf5cae28f4d151 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 6 Dec 2006 15:52:39 +0000 Subject: - Patch #101454 by KarenS and webernet: work around a critical CCK compatibility issue. --- modules/system/system.install | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/modules/system/system.install b/modules/system/system.install index c5dfe1132..50ebba38d 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -3138,6 +3138,24 @@ function system_update_1005() { // Add ability to create dynamic node types like the CCK module $ret = array(); + // The node_type table may already exist for anyone who ever used CCK in 4.7, + // even if CCK is no longer installed. We need to make sure any previously + // created table gets renamed before we create the new node_type table in + // order to ensure that the new table gets created without errors. + // TODO: This check should be removed for Drupal 6. + if (db_table_exists('node_type')) { + switch ($GLOBALS['db_type']) { + case 'mysql': + case 'mysqli': + $ret[] = update_sql('RENAME TABLE {node_type} TO {node_type_content}'); + break; + + case 'pgsql': + $ret[] = update_sql('ALTER TABLE {node_type} RENAME TO {node_type_content}'); + break; + } + } + switch ($GLOBALS['db_type']) { case 'mysqli': case 'mysql': -- cgit v1.2.3