diff backend/doc/schema/postgresql-minfo.sql @ 8032:fd3a24336e6a

SCHEMA CHANGE and Importer (only longitudinal section data so far): only grain fractions given now in schema are valid. We are handling sediment loads, not yields.
author "Tom Gottfried <tom@intevation.de>"
date Mon, 14 Jul 2014 15:36:44 +0200
parents aa8dcf7331a8
children bde5f5ec7c72
line wrap: on
line diff
--- a/backend/doc/schema/postgresql-minfo.sql	Fri Jul 11 13:10:05 2014 +0200
+++ b/backend/doc/schema/postgresql-minfo.sql	Mon Jul 14 15:36:44 2014 +0200
@@ -243,8 +243,20 @@
     name    VARCHAR(64)    NOT NULL,
     lower   NUMERIC,
     upper   NUMERIC,
-    PRIMARY KEY (id)
+    PRIMARY KEY (id),
+    UNIQUE(name, lower, upper)
 );
+-- single fractions
+INSERT INTO grain_fraction VALUES (1, 'coarse', 16, 200);
+INSERT INTO grain_fraction VALUES (2, 'fine_middle', 2, 16);
+INSERT INTO grain_fraction VALUES (3, 'sand', 0.063, 2);
+INSERT INTO grain_fraction VALUES (4, 'susp_sand', 0.063, 2);
+INSERT INTO grain_fraction VALUES (5, 'susp_sand_bed', 0.063, 2);
+INSERT INTO grain_fraction VALUES (6, 'suspended_sediment', 0, 0.063);
+-- aggregations of fractions
+INSERT INTO grain_fraction VALUES (7, 'total', 0, 200);
+INSERT INTO grain_fraction VALUES (8, 'bed_load', 0.063, 200);
+INSERT INTO grain_fraction VALUES (9, 'suspended_load', 0, 2);
 
 
 --lookup table for sediment yield kinds

http://dive4elements.wald.intevation.org