FIX: Don't cause exceptions due to rename of reply_id column

This syncs the value of the `reply_id` column into the `reply_post_id` column until all servers have been deployed and the post migrations ran.

Follow-up to ab07b945c2
This commit is contained in:
Gerhard Schlager
2020-01-17 18:56:15 +01:00
parent b56ade5043
commit cb54bf4f45
3 changed files with 50 additions and 2 deletions

View File

@@ -0,0 +1,12 @@
# frozen_string_literal: true
class MakePostReplyIdColumnReadOnly < ActiveRecord::Migration[6.0]
def up
Migration::ColumnDropper.mark_readonly(:post_replies, :reply_id)
DB.exec("DROP FUNCTION IF EXISTS post_replies_sync_reply_id() CASCADE")
end
def down
raise ActiveRecord::IrreversibleMigration
end
end