mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 18:29:52 +01:00
9 lines
366 B
Ruby
9 lines
366 B
Ruby
# frozen_string_literal: true
|
|
|
|
class RemoveOrphanedNotifications < ActiveRecord::Migration[6.1]
|
|
def up
|
|
execute "DELETE FROM notifications WHERE target_type = 'Appendable' AND target_id NOT IN (SELECT id FROM appendables)"
|
|
|
|
execute "DELETE FROM notifications WHERE target_type = 'Relationship' AND target_id NOT IN (SELECT id FROM relationships)"
|
|
end
|
|
end
|