From: Moritz Bunkus Date: Wed, 2 Apr 2014 11:50:13 +0000 (+0200) Subject: Pflichtenhefte: type_id darf nicht NULL sein X-Git-Tag: release-3.2.0beta~467^2~7 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=75563c5fd46b8e488431908ddd762d3190e628ad;p=kivitendo-erp.git Pflichtenhefte: type_id darf nicht NULL sein --- diff --git a/SL/DB/MetaSetup/RequirementSpec.pm b/SL/DB/MetaSetup/RequirementSpec.pm index 448816a88..667f39a6b 100644 --- a/SL/DB/MetaSetup/RequirementSpec.pm +++ b/SL/DB/MetaSetup/RequirementSpec.pm @@ -22,7 +22,7 @@ __PACKAGE__->meta->columns( status_id => { type => 'integer' }, time_estimation => { type => 'numeric', default => '0', not_null => 1, precision => 12, scale => 2 }, title => { type => 'text', not_null => 1 }, - type_id => { type => 'integer' }, + type_id => { type => 'integer', not_null => 1 }, working_copy_id => { type => 'integer' }, ); diff --git a/sql/Pg-upgrade2/requirement_spec_type_for_template_fix.sql b/sql/Pg-upgrade2/requirement_spec_type_for_template_fix.sql new file mode 100644 index 000000000..a7864390b --- /dev/null +++ b/sql/Pg-upgrade2/requirement_spec_type_for_template_fix.sql @@ -0,0 +1,11 @@ +-- @tag: requirement_spec_type_for_template_fix +-- @description: requirement_spec_type_for_template_fix +-- @depends: requirement_spec_types_number_formats +UPDATE requirement_specs +SET type_id = ( + SELECT MIN(id) + FROM requirement_spec_types +) +WHERE type_id IS NULL; + +ALTER TABLE requirement_specs ALTER COLUMN type_id SET NOT NULL;