Mercurial > dive4elements > river
diff backend/doc/schema/oracle.sql @ 8683:cfafe5764509
(issue 1796) Scheme change! Add model for seddb_name lookup table.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Mon, 13 Apr 2015 11:24:32 +0200 |
parents | 3531f0cee5e1 |
children | 3912da70736b |
line wrap: on
line diff
--- a/backend/doc/schema/oracle.sql Mon Apr 13 11:03:00 2015 +0200 +++ b/backend/doc/schema/oracle.sql Mon Apr 13 11:24:32 2015 +0200 @@ -255,6 +255,14 @@ CHECK (a < b) ); +-- SEDDB_NAME +-- Lookup table for seddb river names +CREATE TABLE seddb_name ( + id NUMBER(38,0) NOT NULL, + name VARCHAR2(255) NOT NULL, + PRIMARY KEY (id) +); +INSERT INTO seddb_name (id, name) VALUES (0, 'Rhein'); -- RIVERS @@ -267,6 +275,7 @@ km_up int DEFAULT 0 NOT NULL, name VARCHAR2(255) NOT NULL UNIQUE, wst_unit_id NUMBER(38,0) NOT NULL, + seddb_name_id NUMBER(38,0), PRIMARY KEY (id), CHECK(km_up IN(0,1)) ); @@ -398,6 +407,7 @@ ALTER TABLE main_values ADD CONSTRAINT cMainValuesTimeIntervals FOREIGN KEY (time_interval_id) REFERENCES time_intervals; ALTER TABLE named_main_values ADD CONSTRAINT cNamedMainValuesMainValueTypes FOREIGN KEY (type_id) REFERENCES main_value_types; ALTER TABLE rivers ADD CONSTRAINT cRiversUnits FOREIGN KEY (wst_unit_id) REFERENCES units; +ALTER TABLE rivers ADD CONSTRAINT cRiversSeddbNames FOREIGN KEY (seddb_name_id) REFERENCES seddb_name; ALTER TABLE wst_columns ADD CONSTRAINT cWstColumnsTime_intervals FOREIGN KEY (time_interval_id) REFERENCES time_intervals; -- Cascading references