From 380b180705378efbcec030773c4d838eef55ddf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonne=20Ha=C3=9F?= Date: Tue, 9 Aug 2016 10:44:09 +0200 Subject: [PATCH] guard against some data inconsistency case in the signature tables migration --- db/migrate/20160720212620_create_signature_tables.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/migrate/20160720212620_create_signature_tables.rb b/db/migrate/20160720212620_create_signature_tables.rb index 8c8157d48..f9e2d6c05 100644 --- a/db/migrate/20160720212620_create_signature_tables.rb +++ b/db/migrate/20160720212620_create_signature_tables.rb @@ -70,7 +70,7 @@ class CreateSignatureTables < ActiveRecord::Migration "SELECT relayable.id, #{order_id}, relayable.author_signature FROM #{relayable_type}s AS relayable " \ "INNER JOIN people AS author ON relayable.author_id = author.id " \ "#{parent_join} INNER JOIN people AS parent_author ON parent.author_id = parent_author.id " \ - "WHERE author.owner_id IS NULL AND parent_author.owner_id IS NOT NULL" + "WHERE author.owner_id IS NULL AND parent_author.owner_id IS NOT NULL AND relayable.author_signature IS NOT NULL" end def restore_signatures(relayable_type)