Remove started sharing notifications where the contact doesn't exist
The same as #7009 but now all of them ;)
This commit is contained in:
parent
5b5e3e2c29
commit
6d8b7b49cb
2 changed files with 3 additions and 2 deletions
|
|
@ -5,7 +5,8 @@ class RemoveStartedSharingNotificationsWithoutContact < ActiveRecord::Migration
|
||||||
def up
|
def up
|
||||||
Notification.where(type: "Notifications::StartedSharing", target_type: "Person")
|
Notification.where(type: "Notifications::StartedSharing", target_type: "Person")
|
||||||
.joins("INNER JOIN people ON people.id = notifications.target_id")
|
.joins("INNER JOIN people ON people.id = notifications.target_id")
|
||||||
.joins("LEFT OUTER JOIN contacts ON contacts.person_id = people.id")
|
.joins("LEFT OUTER JOIN contacts ON contacts.person_id = people.id " \
|
||||||
|
"AND contacts.user_id = notifications.recipient_id")
|
||||||
.delete_all("contacts.id IS NULL")
|
.delete_all("contacts.id IS NULL")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 20160820181334) do
|
ActiveRecord::Schema.define(version: 20160822212739) do
|
||||||
|
|
||||||
create_table "account_deletions", force: :cascade do |t|
|
create_table "account_deletions", force: :cascade do |t|
|
||||||
t.string "diaspora_handle", limit: 255
|
t.string "diaspora_handle", limit: 255
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue