diff options
author | Dries Buytaert <dries@buytaert.net> | 2006-12-06 15:52:39 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2006-12-06 15:52:39 +0000 |
commit | 42f321d0edb8f6c38c83e5cb0baf5cae28f4d151 (patch) | |
tree | 72c1ce78a4c897bfcce4c6ce734eeaa8caa97fd2 /modules | |
parent | 7af1ba1e049f7dd93a916aea5144b7cd4afb531b (diff) | |
download | brdo-42f321d0edb8f6c38c83e5cb0baf5cae28f4d151.tar.gz brdo-42f321d0edb8f6c38c83e5cb0baf5cae28f4d151.tar.bz2 |
- Patch #101454 by KarenS and webernet: work around a critical CCK compatibility issue.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/system/system.install | 18 |
1 files changed, 18 insertions, 0 deletions
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': |