From 9379d7afe63135b2274b3d5f4c27aa0768ba5274 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 8 May 2018 14:34:40 +0200 Subject: [PATCH] Follow up for issue #1977 - recent_views fk already exists, reconnect on postgres to be able to execute further sql statements. --- ...20180426134922_issue_1977_remove_invalid_user_foreign_keys.rb | 1 + 1 file changed, 1 insertion(+) 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 1b795a40a..837172c3d 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 @@ -29,6 +29,7 @@ class Issue1977RemoveInvalidUserForeignKeys < ActiveRecord::Migration[5.1] rescue ActiveRecord::StatementInvalid => e Rails.logger.info "Can't add foreign_keys '#{args.inspect}'" Rails.logger.info e + ActiveRecord::Base.connection.reconnect! end end end