From: Sven Schöling Date: Mon, 28 Jul 2014 13:40:12 +0000 (+0200) Subject: PriceSource: pricegroup migration X-Git-Tag: release-3.2.0beta~171 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=2bdd0bc580210b18c1b76a0d0bd4fc3bd3fceca2;p=kivitendo-erp.git PriceSource: pricegroup migration --- 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;