summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDries2012-01-27 15:34:40 (GMT)
committer Dries2012-01-27 15:34:40 (GMT)
commitcdcb9ec42c0e9f1b1ed7204af82c50e817c1680c (patch)
treeebfcdfcf10ae5aee012940db6d970f4108b12aac
parent99ac453714a264bd7d3cb5fd9aadf8e51f21b81d (diff)
- Patch #1013034 by ncl, kathyh: PostgreSQL constraints do not get renamed by db_rename_table().
-rw-r--r--core/includes/database/pgsql/schema.inc4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/includes/database/pgsql/schema.inc b/core/includes/database/pgsql/schema.inc
index 9ed8a26..49adbf9 100644
--- a/core/includes/database/pgsql/schema.inc
+++ b/core/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);
}
}