From b403498c677894ec7802563777b754e3c26df875 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Thu, 3 Mar 2022 13:31:44 +0100 Subject: [PATCH] qty real nach numeric migrieren Ticket #491 --- SL/DB/MetaSetup/InvoiceItem.pm | 2 +- SL/DB/MetaSetup/OrderItem.pm | 2 +- sql/Pg-upgrade2/convert_real_qty.sql | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 sql/Pg-upgrade2/convert_real_qty.sql diff --git a/SL/DB/MetaSetup/InvoiceItem.pm b/SL/DB/MetaSetup/InvoiceItem.pm index 85b8876be..8a67022fc 100644 --- a/SL/DB/MetaSetup/InvoiceItem.pm +++ b/SL/DB/MetaSetup/InvoiceItem.pm @@ -35,7 +35,7 @@ __PACKAGE__->meta->columns( price_factor_id => { type => 'integer' }, pricegroup_id => { type => 'integer' }, project_id => { type => 'integer' }, - qty => { type => 'float', precision => 4, scale => 4 }, + qty => { type => 'numeric', precision => 25, scale => 5 }, sellprice => { type => 'numeric', precision => 15, scale => 5 }, serialnumber => { type => 'text' }, subtotal => { type => 'boolean', default => 'false' }, diff --git a/SL/DB/MetaSetup/OrderItem.pm b/SL/DB/MetaSetup/OrderItem.pm index afa64d815..e83b65bda 100644 --- a/SL/DB/MetaSetup/OrderItem.pm +++ b/SL/DB/MetaSetup/OrderItem.pm @@ -31,7 +31,7 @@ __PACKAGE__->meta->columns( price_factor_id => { type => 'integer' }, pricegroup_id => { type => 'integer' }, project_id => { type => 'integer' }, - qty => { type => 'float', precision => 4, scale => 4 }, + qty => { type => 'numeric', precision => 25, scale => 5 }, reqdate => { type => 'date' }, sellprice => { type => 'numeric', precision => 15, scale => 5 }, serialnumber => { type => 'text' }, diff --git a/sql/Pg-upgrade2/convert_real_qty.sql b/sql/Pg-upgrade2/convert_real_qty.sql new file mode 100644 index 000000000..5e0ea6531 --- /dev/null +++ b/sql/Pg-upgrade2/convert_real_qty.sql @@ -0,0 +1,7 @@ +-- @tag: convert_real_qty +-- @description: Spaltentyp auf Numeric anstelle von Real für qty +-- @depends: release_3_6_0 +ALTER TABLE orderitems ALTER column qty type numeric(25,5); +ALTER TABLE invoice ALTER column qty type numeric(25,5); + + -- 2.20.1