Shop: shop_trans_id darf auch alphanumerisch sein (e030amdf)
authorJan Büren <jan@kivitendo.de>
Mon, 15 Nov 2021 12:57:14 +0000 (13:57 +0100)
committerJan Büren <jan@kivitendo.de>
Fri, 11 Feb 2022 14:19:56 +0000 (15:19 +0100)
SL/DB/MetaSetup/ShopOrder.pm
SL/DB/MetaSetup/ShopOrderItem.pm
sql/Pg-upgrade2/shop_orders_update_4.sql [new file with mode: 0644]

index cd31c18..6b685fa 100644 (file)
@@ -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' },
index dfb2255..ae7d21a 100644 (file)
@@ -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 (file)
index 0000000..93324fb
--- /dev/null
@@ -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;