X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/deb4d2dbb676d7d6f69dfe7815d6e0cb09bd4a44..53593baa211863fbf66540cf1bcc36c8fb37257f:/sql/Pg-upgrade2-auth/master_rights_positions_fix.sql?ds=sidebyside

diff --git a/sql/Pg-upgrade2-auth/master_rights_positions_fix.sql b/sql/Pg-upgrade2-auth/master_rights_positions_fix.sql
new file mode 100644
index 000000000..5ec5ffa6b
--- /dev/null
+++ b/sql/Pg-upgrade2-auth/master_rights_positions_fix.sql
@@ -0,0 +1,15 @@
+-- @tag: master_rights_positions_fix
+-- @description: Position in Rechtetabelle korrigieren (falls zutreffend)
+-- @depends: release_3_5_4 purchase_letter_rights all_drafts_edit right_purchase_all_edit rights_sales_purchase_edit_prices
+
+UPDATE auth.master_rights SET position = position/100
+       WHERE position > 10000
+       AND   name IN ('purchase_letter_edit', 'purchase_letter_report', 'all_drafts_edit');
+
+UPDATE auth.master_rights SET position = (SELECT position + 10 FROM auth.master_rights WHERE name = 'purchase_letter_edit')
+       WHERE position > 10000
+       AND   name LIKE 'purchase_all_edit';
+
+UPDATE auth.master_rights SET position =(SELECT position + 10 FROM auth.master_rights WHERE name = 'purchase_all_edit')
+       WHERE position > 10000
+       AND   name LIKE 'purchase_edit_prices';
