From: Tom Hughes Date: Sun, 4 May 2008 10:35:59 +0000 (+0000) Subject: When adding new primary keys, drop the old indexes which are no longer X-Git-Tag: live~7569^2~374 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/921518274f3f4b24280023553749adc987ab448a When adding new primary keys, drop the old indexes which are no longer needed as they are a prefix of the new primary key. --- 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