Commit a3037d90 authored by Dries's avatar Dries

- Patch #818214 by David_Rothstein, dereine, JacobSingh: improper table structure for url_alias.

parent 6faef3df
......@@ -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.
*/
......
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