From: Sven Schöling Date: Fri, 1 Oct 2021 14:34:34 +0000 (+0200) Subject: DeliveryOrder order_type db upgrade X-Git-Tag: kivitendo-mebil_0.1-0~10^2~2^2~216^2~79 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=095180009059dfec6d11e179fdb1bd6fc90f4b86;p=kivitendo-erp.git DeliveryOrder order_type db upgrade is_sales noch nicht in der datenbank entfernt, nur im metasetup --- diff --git a/SL/DB/MetaSetup/DeliveryOrder.pm b/SL/DB/MetaSetup/DeliveryOrder.pm index f24fc9f64..994fa96d7 100644 --- a/SL/DB/MetaSetup/DeliveryOrder.pm +++ b/SL/DB/MetaSetup/DeliveryOrder.pm @@ -23,11 +23,11 @@ __PACKAGE__->meta->columns( globalproject_id => { type => 'integer' }, id => { type => 'integer', not_null => 1, sequence => 'id' }, intnotes => { type => 'text' }, - is_sales => { type => 'boolean' }, itime => { type => 'timestamp', default => 'now()' }, language_id => { type => 'integer' }, mtime => { type => 'timestamp' }, notes => { type => 'text' }, + order_type => { type => 'text', not_null => 1 }, ordnumber => { type => 'text' }, oreqnumber => { type => 'text' }, payment_id => { type => 'integer' }, diff --git a/sql/Pg-upgrade2/deliveryorder_type.sql b/sql/Pg-upgrade2/deliveryorder_type.sql new file mode 100644 index 000000000..8e4a0f407 --- /dev/null +++ b/sql/Pg-upgrade2/deliveryorder_type.sql @@ -0,0 +1,12 @@ +-- @tag: deliveryorder_type +-- @description: Persistente Typen in Lieferscheinen +-- @depends: release_3_5_8 + +ALTER TABLE delivery_orders ADD COLUMN order_type TEXT; + +UPDATE delivery_orders SET order_type = 'sales_delivery_order' WHERE customer_id IS NOT NULL; +UPDATE delivery_orders SET order_type = 'purchase_delivery_order' WHERE vendor_id IS NOT NULL; + +ALTER TABLE delivery_orders ALTER COLUMN order_type SET NOT NULL; + +