Commit 61578287 authored by Dennis Schubert's avatar Dennis Schubert

Merge pull request #7009 from SuperTux88/fix-started-sharing-notifications-without-contact

Remove started sharing notifications where the contact doesn't exist
parents 3be0d52b 0e4c8993
class RemoveStartedSharingNotificationsWithoutContact < ActiveRecord::Migration
class Notification < ActiveRecord::Base
end
def up
Notification.where(type: "Notifications::StartedSharing", target_type: "Person")
.joins("INNER JOIN people ON people.id = notifications.target_id")
.joins("LEFT OUTER JOIN contacts ON contacts.person_id = people.id")
.delete_all("contacts.id IS NULL")
end
end
......@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20160813115514) do
ActiveRecord::Schema.define(version: 20160820181334) do
create_table "account_deletions", force: :cascade do |t|
t.string "diaspora_handle", limit: 255
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment