aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenare Degan <henare.degan@gmail.com>2012-12-11 18:27:18 +1100
committerHenare Degan <henare.degan@gmail.com>2013-01-18 01:55:44 +1100
commita5e90e2b7ea6adedbf80c05bbb84425a02c63da0 (patch)
tree4ec1547c79e7550a37d39138f1b04e18cc80f8dd
parentcc91fa28cd0e64576a5f2d8e5c2cb3629636ee74 (diff)
Fix up some DB migration issues with Rails 3
* The public_body_tags table had already been removed * The index has_tag_string_tags generated a name longer than the Postgres maximum of 63 characters. It was ignored in earlier Rails versions, see: https://rails.lighthouseapp.com/projects/8994/tickets/6187-postgresql-and-rails-303-migrations-fail-with-index-name-length-64-chars
-rw-r--r--db/migrate/094_remove_old_tags_foreign_key.rb7
1 files changed, 4 insertions, 3 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..839f76334 100644
--- a/db/migrate/094_remove_old_tags_foreign_key.rb
+++ b/db/migrate/094_remove_old_tags_foreign_key.rb
@@ -4,10 +4,11 @@ class RemoveOldTagsForeignKey < ActiveRecord::Migration
execute "ALTER TABLE has_tag_string_tags DROP CONSTRAINT fk_public_body_tags_public_body"
end
- remove_index :public_body_tags, [:public_body_id, :name, :value]
- remove_index :public_body_tags, :name
+ # 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]
+ 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