diff options
author | Steffen van Bergerem <svbergerem@omgsrsly.net> | 2016-11-30 01:36:42 +0300 |
---|---|---|
committer | Steffen van Bergerem <svbergerem@omgsrsly.net> | 2016-11-30 01:36:42 +0300 |
commit | 154ea6515af8483e634d6b46adc8d522543e682e (patch) | |
tree | bde3cdb429752e9255f2d096da8f9ecdc94d25be /db | |
parent | 3b0c1020c04dc5c04c80e69e650ef433bfa0977c (diff) |
Fix mentions in comments migration on PostgreSQL
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20161107100840_polymorphic_mentions.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/db/migrate/20161107100840_polymorphic_mentions.rb b/db/migrate/20161107100840_polymorphic_mentions.rb index 07b096394..2f00e65fe 100644 --- a/db/migrate/20161107100840_polymorphic_mentions.rb +++ b/db/migrate/20161107100840_polymorphic_mentions.rb @@ -3,7 +3,7 @@ class PolymorphicMentions < ActiveRecord::Migration remove_index :mentions, column: %i(post_id) remove_index :mentions, column: %i(person_id post_id), unique: true rename_column :mentions, :post_id, :mentions_container_id - add_column :mentions, :mentions_container_type, :string, null: false + add_column :mentions, :mentions_container_type, :string add_index :mentions, %i(mentions_container_id mentions_container_type), name: "index_mentions_on_mc_id_and_mc_type", @@ -26,6 +26,7 @@ class PolymorphicMentions < ActiveRecord::Migration def up_down(change) change.up do Mention.update_all(mentions_container_type: "Post") + change_column :mentions, :mentions_container_type, :string, null: false Notification.where(type: "Notifications::Mentioned").update_all(type: "Notifications::MentionedInPost") end |