From 96def4ca5bca620506a0859d48b3df54290e8202 Mon Sep 17 00:00:00 2001 From: "G. Richardson" Date: Tue, 31 Jan 2017 12:13:32 +0100 Subject: [PATCH] Inventory: shippingdate darf nicht leer sein Nachtrag zu Commit 8fd886849e68f --- SL/DB/MetaSetup/Inventory.pm | 2 +- sql/Pg-upgrade2/inventory_shippingdate_not_null.sql | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 sql/Pg-upgrade2/inventory_shippingdate_not_null.sql diff --git a/SL/DB/MetaSetup/Inventory.pm b/SL/DB/MetaSetup/Inventory.pm index 14d1ea158..25530047b 100644 --- a/SL/DB/MetaSetup/Inventory.pm +++ b/SL/DB/MetaSetup/Inventory.pm @@ -23,7 +23,7 @@ __PACKAGE__->meta->columns( parts_id => { type => 'integer', not_null => 1 }, project_id => { type => 'integer' }, qty => { type => 'numeric', precision => 25, scale => 5 }, - shippingdate => { type => 'date' }, + shippingdate => { type => 'date', not_null => 1 }, trans_id => { type => 'integer', not_null => 1 }, trans_type_id => { type => 'integer', not_null => 1 }, warehouse_id => { type => 'integer', not_null => 1 }, diff --git a/sql/Pg-upgrade2/inventory_shippingdate_not_null.sql b/sql/Pg-upgrade2/inventory_shippingdate_not_null.sql new file mode 100644 index 000000000..afb061705 --- /dev/null +++ b/sql/Pg-upgrade2/inventory_shippingdate_not_null.sql @@ -0,0 +1,7 @@ +-- @tag: inventory_shippingdate_not_null +-- @description: shippingdate not null, leeres shippingdate für nachträglich wie itime setzen +-- @depends: release_3_4_0 inventory_fix_shippingdate_assemblies +-- @encoding: utf-8 + +UPDATE inventory SET shippingdate = itime WHERE shippingdate IS NULL; +ALTER TABLE inventory ALTER COLUMN shippingdate SET NOT NULL; -- 2.20.1