From 78d19e27983335bbf6aae17a47799722c9e4b74c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Mon, 15 Nov 2021 13:57:14 +0100 Subject: [PATCH] Shop: shop_trans_id darf auch alphanumerisch sein (e030amdf) --- SL/DB/MetaSetup/ShopOrder.pm | 2 +- SL/DB/MetaSetup/ShopOrderItem.pm | 2 +- sql/Pg-upgrade2/shop_orders_update_4.sql | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 sql/Pg-upgrade2/shop_orders_update_4.sql diff --git a/SL/DB/MetaSetup/ShopOrder.pm b/SL/DB/MetaSetup/ShopOrder.pm index cd31c18b7..6b685fa3e 100644 --- a/SL/DB/MetaSetup/ShopOrder.pm +++ b/SL/DB/MetaSetup/ShopOrder.pm @@ -77,7 +77,7 @@ __PACKAGE__->meta->columns( shop_customer_number => { type => 'text' }, shop_id => { type => 'integer' }, shop_ordernumber => { type => 'text' }, - shop_trans_id => { type => 'integer', not_null => 1 }, + shop_trans_id => { type => 'text', not_null => 1 }, tax_included => { type => 'boolean' }, transfer_date => { type => 'date' }, transferred => { type => 'boolean', default => 'false' }, diff --git a/SL/DB/MetaSetup/ShopOrderItem.pm b/SL/DB/MetaSetup/ShopOrderItem.pm index dfb2255a0..ae7d21aab 100644 --- a/SL/DB/MetaSetup/ShopOrderItem.pm +++ b/SL/DB/MetaSetup/ShopOrderItem.pm @@ -17,7 +17,7 @@ __PACKAGE__->meta->columns( price => { type => 'numeric', precision => 15, scale => 5 }, quantity => { type => 'numeric', precision => 25, scale => 5 }, shop_order_id => { type => 'integer' }, - shop_trans_id => { type => 'integer', not_null => 1 }, + shop_trans_id => { type => 'text', not_null => 1 }, tax_rate => { type => 'numeric', precision => 15, scale => 2 }, ); diff --git a/sql/Pg-upgrade2/shop_orders_update_4.sql b/sql/Pg-upgrade2/shop_orders_update_4.sql new file mode 100644 index 000000000..93324fbf1 --- /dev/null +++ b/sql/Pg-upgrade2/shop_orders_update_4.sql @@ -0,0 +1,8 @@ +-- @tag: shop_orders_update_4 +-- @description: Ändern der Tabellen shop_orders, shop_trans_id darf auch Text enthalten +-- @depends: shop_orders_update_1 shop_orders_update_2 shop_orders_update_3 + +-- @ignore: 0 + +ALTER TABLE shop_orders ALTER COLUMN shop_trans_id TYPE text; +ALTER TABLE shop_order_items ALTER COLUMN shop_trans_id TYPE text; -- 2.20.1