mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 16:38:48 +08:00
FEATURE: Allow watched words to be created as a group (#26632)
At the moment, there is no way to create a group of related watched words together. If a user needed a set of words to be created together, they'll have to create them individually one at a time. This change attempts to allow related watched words to be created as a group. The idea here is to have a list of words be tied together via a common `WatchedWordGroup` record. Given a list of words, a `WatchedWordGroup` record is created and assigned to each `WatchedWord` record. The existing WatchedWord creation behaviour remains largely unchanged. Co-authored-by: Selase Krakani <skrakani@gmail.com> Co-authored-by: Martin Brennan <martin@discourse.org>
This commit is contained in:
11
db/migrate/20230515103515_create_watched_word_groups.rb
Normal file
11
db/migrate/20230515103515_create_watched_word_groups.rb
Normal file
@ -0,0 +1,11 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateWatchedWordGroups < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
create_table :watched_word_groups do |t|
|
||||
t.integer :action, null: false
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,8 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddWatchedWordGroupIdToWatchedWords < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
add_column :watched_words, :watched_word_group_id, :bigint
|
||||
add_index :watched_words, :watched_word_group_id
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user