2019-05-03 08:17:27 +10:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-31 12:06:56 +08:00
|
|
|
class DontAutoMutoTopics < ActiveRecord::Migration[4.2]
|
2014-06-18 11:23:31 +10:00
|
|
|
def change
|
|
|
|
# muting all new topics was a mistake, revert it
|
2023-01-09 11:59:41 +00:00
|
|
|
execute "DELETE FROM topic_users WHERE notification_level = 0 and notifications_reason_id =7 AND first_visited_at IS NULL"
|
2014-06-18 11:23:31 +10:00
|
|
|
|
2023-01-09 11:59:41 +00:00
|
|
|
execute "UPDATE topic_users SET notification_level = 1,
|
2014-06-18 11:23:31 +10:00
|
|
|
notifications_reason_id = NULL
|
2023-01-09 11:59:41 +00:00
|
|
|
WHERE notification_level = 0 AND notifications_reason_id =7"
|
2014-06-18 11:23:31 +10:00
|
|
|
end
|
|
|
|
end
|