Inventory: shippingdate darf nicht leer sein
authorG. Richardson <information@kivitendo-premium.de>
Tue, 31 Jan 2017 11:13:32 +0000 (12:13 +0100)
committerG. Richardson <information@kivitendo-premium.de>
Tue, 31 Jan 2017 15:40:10 +0000 (16:40 +0100)
Nachtrag zu Commit 8fd886849e68f

SL/DB/MetaSetup/Inventory.pm
sql/Pg-upgrade2/inventory_shippingdate_not_null.sql [new file with mode: 0644]

index 14d1ea1..2553004 100644 (file)
@@ -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 (file)
index 0000000..afb0617
--- /dev/null
@@ -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;