mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
DEV: Create permanent version of moved_posts
table from PostMover class (#29664)
This is a very simple change, which creates a permanent table in the DB, rather than generating a temporary table when moving posts. This change is about capturing data and any usage will appear in a follow-up. I did include a new column created_new_topic in the new table, so that it can be easily audited without having to compare destination topic created_at with moved_post records.
This commit is contained in:

committed by
GitHub

parent
a0242764f3
commit
9b8af0ea9f
17
db/migrate/20241108154026_create_moved_posts.rb
Normal file
17
db/migrate/20241108154026_create_moved_posts.rb
Normal file
@ -0,0 +1,17 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateMovedPosts < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
create_table :moved_posts do |t|
|
||||
t.bigint :old_topic_id, null: false, index: true
|
||||
t.bigint :old_post_id, null: false, index: true
|
||||
t.bigint :old_post_number, null: false, index: true
|
||||
t.bigint :new_topic_id, null: false, index: true
|
||||
t.string :new_topic_title, null: false
|
||||
t.bigint :new_post_id, null: false, index: true
|
||||
t.bigint :new_post_number, null: false
|
||||
t.boolean :created_new_topic, null: false, default: false
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user