Merge pull request #762 from knl/fix-declarative-jobset-missing-type-value

Fix declarative jobset missing type value
This commit is contained in:
Bas van Dijk 2020-05-18 11:04:00 +02:00 committed by GitHub
commit 03f14f46d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View file

@ -43,6 +43,8 @@ sub updateDeclarativeJobset {
);
my %update = ( name => $jobsetName );
foreach my $key (@allowed_keys) {
# do not pass missing data to let psql assign the default value
next unless defined $declSpec->{$key};
$update{$key} = $declSpec->{$key};
delete $declSpec->{$key};
}

2
src/sql/upgrade-66.sql Normal file
View file

@ -0,0 +1,2 @@
update Jobsets set type = 0 where type is null;
alter table Jobsets alter column type set not null;