@@ -, +, @@ alter table borrower_relationships modify column `guarantor_id` int(11) NULL; insert into borrower_relationships (guarantee_id,relationship) values (SOME_PATRON_ID,'father'); You should see NOT NULL with guarantor_id. --- installer/data/mysql/db_revs/220600048.pl | 5 +++++ 1 file changed, 5 insertions(+) --- a/installer/data/mysql/db_revs/220600048.pl +++ a/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 }); --