From 921518274f3f4b24280023553749adc987ab448a Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sun, 4 May 2008 10:35:59 +0000 Subject: [PATCH] When adding new primary keys, drop the old indexes which are no longer needed as they are a prefix of the new primary key. --- db/migrate/015_key_constraints.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/db/migrate/015_key_constraints.rb b/db/migrate/015_key_constraints.rb index 6a070b2da..40f98be02 100644 --- a/db/migrate/015_key_constraints.rb +++ b/db/migrate/015_key_constraints.rb @@ -11,6 +11,15 @@ class KeyConstraints < ActiveRecord::Migration add_primary_key :nodes, [:id, :version] + # Remove indexes superseded by primary keys + remove_index :current_way_tags, :name => :current_way_tags_id_idx + remove_index :current_relation_tags, :name => :current_relation_tags_id_idx + + remove_index :way_tags, :name => :way_tags_id_version_idx + remove_index :relation_tags, :name => :relation_tags_id_version_idx + + remove_index :nodes, :name => :nodes_uid_idx + # Foreign keys (between ways, way_tags, way_nodes, etc.) add_foreign_key :current_node_tags, [:id], :current_nodes add_foreign_key :node_tags, [:id, :version], :nodes -- 2.43.2