mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 03:16:41 +08:00
1476e17c35
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.
17 lines
445 B
Ruby
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
|