diff options
-rw-r--r-- | db/migrate/094_remove_old_tags_foreign_key.rb | 7 |
1 files changed, 3 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 1a87b97c2..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,11 @@ 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 - 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] + 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 |