discourse/db/migrate/20201027110546_create_linked_topics.rb
Arpit Jalan 1476e17c35
FEATURE: new setting to create a linked topic on autoclosing mega topics (#11001)
This commit adds a site setting `auto_close_topics_create_linked_topic`
which when enabled works in conjunction with `auto_close_topics_post_count`
setting and creates a new linked topic for the topic just closed.

The auto-created new topic contains a link for all the previous topics
and the topic titles are appended with `(Part {n})`.

The setting is enabled by default.
2020-11-02 12:18:48 +05:30

17 lines
445 B
Ruby

# frozen_string_literal: true
class CreateLinkedTopics < ActiveRecord::Migration[6.0]
def change
create_table :linked_topics do |t|
t.bigint :topic_id, null: false
t.bigint :original_topic_id, null: false
t.integer :sequence, null: false
t.timestamps
end
add_index :linked_topics, [:topic_id, :original_topic_id], unique: true
add_index :linked_topics, [:topic_id, :sequence], unique: true
end
end