discourse/db/migrate/20241205162117_add_columns_to_moved_posts.rb
Mark VanLandingham 71bec686a2
DEV: Add user_id and post_user_id to MovedPost records (#30130)
Follow-up from this commit - 9b8af0ea9f

Adds helpful data into MovedPost records for later lookup. ALSO fixes notifications for freeze_original to point to the newly created post, not the moved post.
2024-12-05 17:10:32 -06:00

12 lines
402 B
Ruby

# frozen_string_literal: true
class AddColumnsToMovedPosts < ActiveRecord::Migration[7.2]
def change
add_column :moved_posts, :old_topic_title, :string
add_column :moved_posts, :post_user_id, :integer
add_column :moved_posts, :user_id, :integer
# Index for querying moved_posts for post author given a new topic ID
add_index :moved_posts, %i[new_topic_id post_user_id]
end
end