mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
This reverts commit 7aff9806eb3592767313299d7a0b8c413e328d20.
This commit is contained in:

committed by
GitHub

parent
67a7b28096
commit
40d65dddf8
@ -1,56 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
Flag.seed do |s|
|
||||
s.id = 3
|
||||
s.name = "off_topic"
|
||||
s.position = 2
|
||||
s.notify_type = true
|
||||
s.auto_action_type = true
|
||||
s.custom_type = false
|
||||
s.applies_to = %w[Post Chat::Message]
|
||||
end
|
||||
Flag.seed do |s|
|
||||
s.id = 4
|
||||
s.name = "inappropriate"
|
||||
s.position = 3
|
||||
s.notify_type = true
|
||||
s.auto_action_type = true
|
||||
s.custom_type = false
|
||||
s.applies_to = %w[Post Topic Chat::Message]
|
||||
end
|
||||
Flag.seed do |s|
|
||||
s.id = 8
|
||||
s.name = "spam"
|
||||
s.position = 4
|
||||
s.notify_type = true
|
||||
s.auto_action_type = true
|
||||
s.custom_type = false
|
||||
s.applies_to = %w[Post Topic Chat::Message]
|
||||
end
|
||||
Flag.seed do |s|
|
||||
s.id = 6
|
||||
s.name = "notify_user"
|
||||
s.position = 0
|
||||
s.notify_type = false
|
||||
s.auto_action_type = false
|
||||
s.custom_type = true
|
||||
s.applies_to = %w[Post Chat::Message]
|
||||
end
|
||||
Flag.seed do |s|
|
||||
s.id = 7
|
||||
s.name = "notify_moderators"
|
||||
s.position = 1
|
||||
s.notify_type = true
|
||||
s.auto_action_type = false
|
||||
s.custom_type = true
|
||||
s.applies_to = %w[Post Topic Chat::Message]
|
||||
end
|
||||
Flag.seed do |s|
|
||||
s.id = 10
|
||||
s.name = "illegal"
|
||||
s.position = 5
|
||||
s.notify_type = true
|
||||
s.auto_action_type = false
|
||||
s.custom_type = true
|
||||
s.applies_to = %w[Post Topic Chat::Message]
|
||||
end
|
@ -18,7 +18,7 @@ class AddFlagStatsToUser < ActiveRecord::Migration[5.2]
|
||||
SUM(CASE WHEN pa.deferred_at IS NOT NULL THEN 1 ELSE 0 END) as flags_ignored
|
||||
FROM post_actions AS pa
|
||||
INNER JOIN users AS u ON u.id = pa.user_id
|
||||
WHERE pa.post_action_type_id IN (3, 4, 8, 7, 10)
|
||||
WHERE pa.post_action_type_id IN (#{PostActionType.notify_flag_types.values.join(", ")})
|
||||
AND pa.user_id > 0
|
||||
GROUP BY u.id
|
||||
) AS x
|
||||
|
@ -1,19 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateFlags < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
create_table :flags do |t|
|
||||
t.string :name, unique: true
|
||||
t.string :name_key, unique: true
|
||||
t.text :description
|
||||
t.boolean :notify_type, default: false, null: false
|
||||
t.boolean :auto_action_type, default: false, null: false
|
||||
t.boolean :custom_type, default: false, null: false
|
||||
t.string :applies_to, array: true, null: false
|
||||
t.integer :position, null: false
|
||||
t.boolean :enabled, default: true, null: false
|
||||
t.timestamps
|
||||
end
|
||||
DB.exec("SELECT setval('flags_id_seq', 1001, FALSE);")
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user