changeset 754:5bcf338eadb9

Added a new view to select ws of a WST. flys-backend/trunk@1986 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 24 May 2011 10:49:14 +0000
parents 677a6fceea6e
children a29fd0916803
files flys-backend/ChangeLog flys-backend/doc/schema/postgresql.sql
diffstat 2 files changed, 26 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-backend/ChangeLog	Mon May 23 15:01:58 2011 +0000
+++ b/flys-backend/ChangeLog	Tue May 24 10:49:14 2011 +0000
@@ -1,3 +1,18 @@
+2011-05-24	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* doc/schema/postgresql.sql: Added a new view to select ws of a WST.
+	  To update existing databases:
+
+	    CREATE VIEW wst_w_values AS
+	        SELECT wcv."position" AS km, 
+	               wcv.w          AS w,  
+	               wc."position"  AS column_pos, 
+	               w.id           AS wst_id
+	            FROM wst_column_values wcv
+	            JOIN wst_columns wc ON wcv.wst_column_id = wc.id
+	            JOIN wsts w         ON wc.wst_id = w.id
+	        ORDER BY wcv."position", wc."position";
+
 2011-05-23	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	 flys/issue76
--- a/flys-backend/doc/schema/postgresql.sql	Mon May 23 15:01:58 2011 +0000
+++ b/flys-backend/doc/schema/postgresql.sql	Tue May 24 10:49:14 2011 +0000
@@ -217,4 +217,15 @@
     ORDER  BY wcv.position ASC,
           wc.position DESC;
 
+-- view to select the w values of a WST
+CREATE VIEW wst_w_values AS
+    SELECT wcv."position" AS km, 
+           wcv.w          AS w,  
+           wc."position"  AS column_pos, 
+           w.id           AS wst_id
+        FROM wst_column_values wcv
+        JOIN wst_columns wc ON wcv.wst_column_id = wc.id
+        JOIN wsts w         ON wc.wst_id = w.id
+    ORDER BY wcv."position", wc."position";
+
 COMMIT;

http://dive4elements.wald.intevation.org