mirror of
https://github.com/discourse/discourse.git
synced 2026-07-31 16:48:26 -05:00
remove invalid topic_users rows
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
class RemoveInvalidTopicUser < ActiveRecord::Migration
|
||||
def up
|
||||
execute <<-SQL
|
||||
DELETE FROM topic_users
|
||||
USING topic_users tu
|
||||
LEFT JOIN users u ON u.id = tu.user_id
|
||||
WHERE u.id IS NULL
|
||||
AND topic_users.id = tu.id
|
||||
SQL
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user