# HG changeset patch # User Sascha L. Teichmann # Date 1383130749 -3600 # Node ID 5cddf115b27be5081340b3d81a5a93c57e7638cb # Parent 4b29bb2c785f542bebb207b2445a3806edc94a74# Parent 5b5a2cc8210f5de3c2fb6ff54fdcc53076c0f2b4 Merged diff -r 4b29bb2c785f -r 5cddf115b27b backend/doc/schema/oracle-minfo.sql --- a/backend/doc/schema/oracle-minfo.sql Wed Oct 30 11:58:57 2013 +0100 +++ b/backend/doc/schema/oracle-minfo.sql Wed Oct 30 11:59:09 2013 +0100 @@ -250,6 +250,13 @@ PRIMARY KEY (id) ); +--lookup table for sediment yield kinds +CREATE TABLE sediment_yield_kinds ( + id int PRIMARY KEY NOT NULL, + kind VARCHAR(64) NOT NULL +); +INSERT INTO sediment_yield_kinds (id, kind) VALUES (0, 'non-official'); +INSERT INTO sediment_yield_kinds (id, kind) VALUES (1, 'official'); CREATE SEQUENCE SEDIMENT_YIELD_ID_SEQ; @@ -263,6 +270,7 @@ kind NUMBER(38,0), PRIMARY KEY (id), CONSTRAINT fk_sy_river_id FOREIGN KEY (river_id) REFERENCES rivers(id) ON DELETE CASCADE, + CONSTRAINT fk_sy_kind_id FOREIGN KEY (kind) REFERENCES sediment_yield_kinds(id), CONSTRAINT fk_sy_grain_fraction_id FOREIGN KEY (grain_fraction_id) REFERENCES grain_fraction(id), CONSTRAINT fk_sy_unit_id FOREIGN KEY (unit_id) REFERENCES units(id), CONSTRAINT fk_sy_time_interval_id FOREIGN KEY (time_interval_id) REFERENCES time_intervals(id) diff -r 4b29bb2c785f -r 5cddf115b27b backend/doc/schema/postgresql-minfo.sql --- a/backend/doc/schema/postgresql-minfo.sql Wed Oct 30 11:58:57 2013 +0100 +++ b/backend/doc/schema/postgresql-minfo.sql Wed Oct 30 11:59:09 2013 +0100 @@ -251,6 +251,14 @@ ); +--lookup table for sediment yield kinds +CREATE TABLE sediment_yield_kinds ( + id int PRIMARY KEY NOT NULL, + kind VARCHAR(64) NOT NULL +); +INSERT INTO sediment_yield_kinds (id, kind) VALUES (0, 'non-official'); +INSERT INTO sediment_yield_kinds (id, kind) VALUES (1, 'official'); + CREATE SEQUENCE SEDIMENT_YIELD_ID_SEQ; CREATE TABLE sediment_yield ( @@ -263,6 +271,7 @@ kind int, PRIMARY KEY (id), CONSTRAINT fk_sy_river_id FOREIGN KEY (river_id) REFERENCES rivers(id) ON DELETE CASCADE, + CONSTRAINT fk_sy_kind_id FOREIGN KEY (kind) REFERENCES sediment_yield_kinds(id), CONSTRAINT fk_sy_grain_fraction_id FOREIGN KEY (grain_fraction_id) REFERENCES grain_fraction(id), CONSTRAINT fk_sy_unit_id FOREIGN KEY (unit_id) REFERENCES units(id), CONSTRAINT fk_sy_time_interval_id FOREIGN KEY (time_interval_id) REFERENCES time_intervals(id)