diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-01-17 17:46:13 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-01-17 17:46:13 +0000 |
commit | e11acad45d13024c396b679b866e761417079232 (patch) | |
tree | 0114b0fb9b50dc5d8540300762b45b088d30faa2 | |
parent | 153fcf56924dd581fbdaad0ff7d3c6b5e5d95a24 (diff) |
Drop the obsolete indexes explicitly by name - the 'remove_index' calls don't work as the table has been renamed, and they automatically generate the index name from the table name. Apply custom index name from a5e90e2b7ea6adedbf80c05bbb84425a02c63da0.
-rw-r--r-- | db/migrate/094_remove_old_tags_foreign_key.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/db/migrate/094_remove_old_tags_foreign_key.rb b/db/migrate/094_remove_old_tags_foreign_key.rb index 839f76334..5a6a00acc 100644 --- a/db/migrate/094_remove_old_tags_foreign_key.rb +++ b/db/migrate/094_remove_old_tags_foreign_key.rb @@ -2,12 +2,10 @@ class RemoveOldTagsForeignKey < ActiveRecord::Migration def self.up if ActiveRecord::Base.connection.adapter_name == "PostgreSQL" execute "ALTER TABLE has_tag_string_tags DROP CONSTRAINT fk_public_body_tags_public_body" + execute 'DROP INDEX index_public_body_tags_on_public_body_id_and_name_and_value' + execute 'DROP INDEX index_public_body_tags_on_name' end - # This table was already removed in the previous migration - # remove_index :public_body_tags, [:public_body_id, :name, :value] - # remove_index :public_body_tags, :name - add_index :has_tag_string_tags, [:model, :model_id, :name, :value], :name => 'by_model_and_model_id_and_name_and_value' add_index :has_tag_string_tags, :name end |