summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2012-02-14 13:23:04 -0500
committerwebchick <webchick@24967.no-reply.drupal.org>2012-02-14 13:23:04 -0500
commitdf5c8687f1bec591a7c2076f9b0ce0e55764e890 (patch)
tree33ba75423d98561bec5d25ab6683130da06e76f2
parent29dba9a4a86c581dab9834698c95bb502625b9f3 (diff)
downloadbrdo-df5c8687f1bec591a7c2076f9b0ce0e55764e890.tar.gz
brdo-df5c8687f1bec591a7c2076f9b0ce0e55764e890.tar.bz2
Issue #1013034 by ncl: Fixed PostgreSQL constraints do not get renamed by db_rename_table().
-rw-r--r--includes/database/pgsql/schema.inc4
1 files changed, 2 insertions, 2 deletions
diff --git a/includes/database/pgsql/schema.inc b/includes/database/pgsql/schema.inc
index 9ed8a2620..49adbf907 100644
--- a/includes/database/pgsql/schema.inc
+++ b/includes/database/pgsql/schema.inc
@@ -328,9 +328,9 @@ class DatabaseSchema_pgsql extends DatabaseSchema {
// rename them when renaming the table.
$indexes = $this->connection->query('SELECT indexname FROM pg_indexes WHERE schemaname = :schema AND tablename = :table', array(':schema' => $old_schema, ':table' => $old_table_name));
foreach ($indexes as $index) {
- if (preg_match('/^' . preg_quote($old_full_name) . '_(.*)_idx$/', $index->indexname, $matches)) {
+ if (preg_match('/^' . preg_quote($old_full_name) . '_(.*)$/', $index->indexname, $matches)) {
$index_name = $matches[1];
- $this->connection->query('ALTER INDEX ' . $index->indexname . ' RENAME TO {' . $new_name . '}_' . $index_name . '_idx');
+ $this->connection->query('ALTER INDEX ' . $index->indexname . ' RENAME TO {' . $new_name . '}_' . $index_name);
}
}