mirror of
https://github.com/discourse/discourse.git
synced 2026-08-12 05:55:39 -05:00
FIX:Add migration to delete tracking state for staged users (#10083)
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class DeleteTrackingStateForStagedUsers < ActiveRecord::Migration[6.0]
|
||||
def up
|
||||
execute <<~SQL
|
||||
DELETE FROM category_users
|
||||
WHERE user_id IN (SELECT id FROM users WHERE staged = true)
|
||||
SQL
|
||||
|
||||
execute <<~SQL
|
||||
DELETE FROM tag_users
|
||||
WHERE user_id IN (SELECT id FROM users WHERE staged = true)
|
||||
SQL
|
||||
end
|
||||
|
||||
def down
|
||||
raise ActiveRecord::IrreversibleMigration
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user