diff db_schema/stammdaten_schema.sql @ 879:6bd149c352a9

Available status values need to be filtered by the users functions.
author Tom Gottfried <tom@intevation.de>
date Thu, 11 Feb 2016 16:23:38 +0100
parents ad64ef3379a8
children fa7278bd8d73
line wrap: on
line diff
--- a/db_schema/stammdaten_schema.sql	Thu Feb 11 16:21:57 2016 +0100
+++ b/db_schema/stammdaten_schema.sql	Thu Feb 11 16:23:38 2016 +0100
@@ -725,17 +725,16 @@
 
 
 CREATE VIEW status_erreichbar AS (
-    SELECT DISTINCT k.wert_id,
-        j.wert_id AS cur_wert,
-        j.stufe_id AS cur_stufe
-    FROM stammdaten.status_kombi k
-    JOIN (SELECT r.zu_id,
-              kom.wert_id,
-              kom.stufe_id
-          FROM stammdaten.status_reihenfolge r
-          JOIN stammdaten.status_kombi kom
-          ON kom.id = r.von_id) j
-    ON j.zu_id = k.id
+    SELECT r.id,
+           zu.wert_id,
+           zu.stufe_id,
+           von.wert_id AS cur_wert,
+           von.stufe_id AS cur_stufe
+    FROM stammdaten.status_reihenfolge r
+        JOIN stammdaten.status_kombi von
+            ON von.id = r.von_id
+        JOIN stammdaten.status_kombi zu
+            ON zu.id = r.zu_id
 );
 -- Status workflow
 
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)