mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
REFACTOR: Replace score bonuses with low/med/high priorities
We removed score from the UX so it makes more sense to have sites set priorities instead of score bonuses.
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddPriorityToPostActionTypes < ActiveRecord::Migration[5.2]
|
||||
def up
|
||||
add_column :post_action_types, :reviewable_priority, :integer, default: 0, null: false
|
||||
execute(<<~SQL)
|
||||
UPDATE post_action_types
|
||||
SET reviewable_priority = CASE
|
||||
WHEN score_bonus > 5 THEN 10
|
||||
WHEN score_bonus > 0 THEN 5
|
||||
ELSE 0
|
||||
END
|
||||
SQL
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :post_action_types, :reviewable_priority
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user