discourse/db/migrate/20200116140132_rename_reply_id_column.rb
Gerhard Schlager cb54bf4f45 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
2020-01-17 19:43:00 +01:00

17 lines
315 B
Ruby

# frozen_string_literal: true
class RenameReplyIdColumn < ActiveRecord::Migration[6.0]
def up
add_column :post_replies, :reply_post_id, :integer
execute <<~SQL
UPDATE post_replies
SET reply_post_id = reply_id
SQL
end
def down
raise ActiveRecord::IrreversibleMigration
end
end