From bd0ab9a5fbaa908edf11ea71c3c1df8a9991e5a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20He=C3=9F?= Date: Sun, 13 Sep 2020 14:39:35 +0200 Subject: [PATCH] Stop violating not null constraint Fixes this error: ERROR: failed to process declarative jobset test:inputs, DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::Pg::st execute failed: ERROR: null value in column "emailoverride" violates not-null constraint --- src/lib/Hydra/Helper/AddBuilds.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/Hydra/Helper/AddBuilds.pm b/src/lib/Hydra/Helper/AddBuilds.pm index ae75e1fa..80faeaa0 100644 --- a/src/lib/Hydra/Helper/AddBuilds.pm +++ b/src/lib/Hydra/Helper/AddBuilds.pm @@ -57,7 +57,7 @@ sub updateDeclarativeJobset { name => $name, type => $data->{type} }; - $row->{emailresponsible} = $data->{emailresponsible} if defined $data->{emailresponsible}; + $row->{emailresponsible} = $data->{emailresponsible} // 0; my $input = $jobset->jobsetinputs->create($row); $input->jobsetinputalts->create({altnr => 0, value => $data->{value}}); }