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

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