Mercurial > dive4elements > river
diff backend/doc/schema/postgresql.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/postgresql.sql Mon Apr 13 11:03:00 2015 +0200 +++ b/backend/doc/schema/postgresql.sql Mon Apr 13 11:24:32 2015 +0200 @@ -7,6 +7,15 @@ name VARCHAR(32) NOT NULL UNIQUE ); +-- SEDDB_NAME +-- Lookup table for seddb river names + +CREATE TABLE seddb_name ( + id int PRIMARY KEY NOT NULL, + name VARCHAR(256) NOT NULL +); +INSERT INTO seddb_name (id, name) VALUES (0, 'Rhein'); + -- Gewaesser CREATE SEQUENCE RIVERS_ID_SEQ; @@ -17,6 +26,7 @@ name VARCHAR(256) NOT NULL UNIQUE, km_up int DEFAULT 0 NOT NULL, wst_unit_id int NOT NULL REFERENCES units(id), + seddb_name_id int REFERENCES seddb_name(id), CHECK(km_up IN(0,1)) );