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>2012-12-11 18:27:18 +1100
commit0969c6997e3795fa8c2b0d77b283b9746369a0b8 (patch)
treecb3fa1a5ba71e63b15269d157e6cb66a05ac9305
parent447e4afe27a6243b05b760dd2c0a7ffcdaa0d56e (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