From a3037d90c07239e4a7c8d5a3a19016c2ac377de2 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 24 Jul 2010 18:12:27 +0000 Subject: - Patch #818214 by David_Rothstein, dereine, JacobSingh: improper table structure for url_alias. --- modules/system/system.install | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'modules/system/system.install') diff --git a/modules/system/system.install b/modules/system/system.install index c83bc60fe..9fd1b714a 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -1564,12 +1564,10 @@ function system_schema() { 'default' => '', ), ), - 'unique keys' => array( - 'alias_language' => array('alias', 'language'), - ), 'primary key' => array('pid'), 'indexes' => array( - 'source_language' => array('source', 'language'), + 'alias_language_pid' => array('alias', 'language', 'pid'), + 'source_language_pid' => array('source', 'language', 'pid'), ), ); @@ -2299,9 +2297,10 @@ function system_update_7042() { // Rename the fields, and increase their length to 255 characters. db_change_field('url_alias', 'src', 'source', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '')); db_change_field('url_alias', 'dst', 'alias', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '')); - // Add indexes back. + // Add indexes back. We replace the unique key with an index since it never + // provided any meaningful unique constraint ('pid' is a primary key). db_add_index('url_alias', 'source_language_pid', array('source', 'language', 'pid')); - db_add_unique_key('url_alias', 'alias_language_pid', array('alias', 'language', 'pid')); + db_add_index('url_alias', 'alias_language_pid', array('alias', 'language', 'pid')); } /** @@ -2556,18 +2555,6 @@ function system_update_7055() { db_change_field('system', 'info', 'info', $spec); } -/** - * Remove pid from indexes and unique keys of {url_alias}. - */ -function system_update_7056() { - // Drop indexes. - db_drop_index('url_alias', 'source_language_pid'); - db_drop_unique_key('url_alias', 'alias_language_pid'); - // Add indexes back. - db_add_index('url_alias', 'source_language', array('source', 'language')); - db_add_unique_key('url_alias', 'alias_language', array('alias', 'language')); -} - /** * Increase the size of session-ids. */ -- cgit v1.2.3