diff --git a/installer/data/mysql/db_revs/220600048.pl b/installer/data/mysql/db_revs/220600048.pl index 9c35ccec5d..8fb5e9c322 100755 --- a/installer/data/mysql/db_revs/220600048.pl +++ b/installer/data/mysql/db_revs/220600048.pl @@ -6,6 +6,11 @@ return { up => sub { my ($args) = @_; my ($dbh, $out) = @$args{qw(dbh out)}; + + # Delete 'empty' guarantors. No longer possible to add them via interface. Have no use. + $dbh->do(q{ +DELETE FROM borrower_relationships WHERE guarantor_id IS NULL + }); $dbh->do(q{ ALTER TABLE borrower_relationships CHANGE COLUMN guarantor_id guarantor_id int(11) NOT NULL });