X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/deb4d2dbb676d7d6f69dfe7815d6e0cb09bd4a44..53593baa211863fbf66540cf1bcc36c8fb37257f:/sql/Pg-upgrade2/pricegroup_sortkey_obsolete.sql

diff --git a/sql/Pg-upgrade2/pricegroup_sortkey_obsolete.sql b/sql/Pg-upgrade2/pricegroup_sortkey_obsolete.sql
new file mode 100644
index 000000000..684bf375d
--- /dev/null
+++ b/sql/Pg-upgrade2/pricegroup_sortkey_obsolete.sql
@@ -0,0 +1,12 @@
+-- @tag: pricegroup_sortkey_obsolete
+-- @description: Sortierreihenfolge und ungÃ¼ltig fÃ¼r Preisgruppen
+-- @depends: release_3_4_1
+-- @ignore: 0
+
+ALTER TABLE pricegroup ADD COLUMN obsolete BOOLEAN DEFAULT FALSE;
+ALTER TABLE pricegroup ADD COLUMN sortkey INTEGER;
+
+CREATE SEQUENCE tmp_counter;
+UPDATE pricegroup SET sortkey = nextval('tmp_counter');
+DROP SEQUENCE tmp_counter;
+ALTER TABLE pricegroup ALTER COLUMN sortkey SET NOT NULL;
