From 156abbbcf9c89933ffa56e19cc686e602b9e7a1e Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 8 May 2018 13:29:43 +0200 Subject: [PATCH] Folllow up for issue #1977 - recent_views fk already exists. --- ...0426134922_issue_1977_remove_invalid_user_foreign_keys.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/db/migrate/20180426134922_issue_1977_remove_invalid_user_foreign_keys.rb b/db/migrate/20180426134922_issue_1977_remove_invalid_user_foreign_keys.rb index d431c98af..1b795a40a 100644 --- a/db/migrate/20180426134922_issue_1977_remove_invalid_user_foreign_keys.rb +++ b/db/migrate/20180426134922_issue_1977_remove_invalid_user_foreign_keys.rb @@ -15,15 +15,12 @@ class Issue1977RemoveInvalidUserForeignKeys < ActiveRecord::Migration[5.1] Avatar.joins('LEFT OUTER JOIN users ON avatars.o_id = users.id') .where('users.id IS NULL') - .where( - object_lookup_id: ObjectLookup.by_name('User') - ) + .where(object_lookup_id: ObjectLookup.by_name('User')) .destroy_all # add (possibly) missing foreign_key foreign_keys = [ %i[online_notifications users], - [:recent_views, :users, column: :created_by_id] ] foreign_keys.each do |args|