From 2bdd0bc580210b18c1b76a0d0bd4fc3bd3fceca2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Mon, 28 Jul 2014 15:40:12 +0200 Subject: [PATCH] PriceSource: pricegroup migration --- sql/Pg-upgrade2/recorditem_active_price_source.sql | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sql/Pg-upgrade2/recorditem_active_price_source.sql b/sql/Pg-upgrade2/recorditem_active_price_source.sql index c391335b1..56f88c093 100644 --- a/sql/Pg-upgrade2/recorditem_active_price_source.sql +++ b/sql/Pg-upgrade2/recorditem_active_price_source.sql @@ -3,6 +3,10 @@ -- @depends: release_2_6_2 -- @encoding: utf-8 -ALTER TABLE orderitems ADD COLUMN active_price_source TEXT NOT NULL DEFAULT ''; +ALTER TABLE orderitems ADD COLUMN active_price_source TEXT NOT NULL DEFAULT ''; ALTER TABLE delivery_order_items ADD COLUMN active_price_source TEXT NOT NULL DEFAULT ''; -ALTER TABLE invoice ADD COLUMN active_price_source TEXT NOT NULL DEFAULT ''; +ALTER TABLE invoice ADD COLUMN active_price_source TEXT NOT NULL DEFAULT ''; + +UPDATE orderitems SET active_price_source = 'pricegroup/' || pricegroup_id WHERE pricegroup_id > 0; +UPDATE delivery_order_items SET active_price_source = 'pricegroup/' || pricegroup_id WHERE pricegroup_id > 0; +UPDATE invoice SET active_price_source = 'pricegroup/' || pricegroup_id WHERE pricegroup_id > 0; -- 2.20.1