Mercurial > dive4elements > river
comparison flys-backend/doc/schema/postgresql.sql @ 2346:f834b411ca57
Added db table, model class and importer stuff for units.
flys-backend/trunk@2877 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 04 Oct 2011 06:47:00 +0000 |
parents | 1dbafbba50ea |
children | 0acf28a3d28a |
comparison
equal
deleted
inserted
replaced
2345:c3ea91aee989 | 2346:f834b411ca57 |
---|---|
13 CREATE SEQUENCE ATTRIBUTES_ID_SEQ; | 13 CREATE SEQUENCE ATTRIBUTES_ID_SEQ; |
14 | 14 |
15 CREATE TABLE attributes ( | 15 CREATE TABLE attributes ( |
16 id int PRIMARY KEY NOT NULL, | 16 id int PRIMARY KEY NOT NULL, |
17 value VARCHAR(256) NOT NULL UNIQUE | 17 value VARCHAR(256) NOT NULL UNIQUE |
18 ); | |
19 | |
20 CREATE SEQUENCE UNITS_ID_SEQ; | |
21 | |
22 CREATE TABLE units ( | |
23 id int PRIMARY KEY NOT NULL, | |
24 name VARCHAR(32) NOT NULL UNIQUE | |
18 ); | 25 ); |
19 | 26 |
20 -- segments from/to at a river | 27 -- segments from/to at a river |
21 CREATE SEQUENCE RANGES_ID_SEQ; | 28 CREATE SEQUENCE RANGES_ID_SEQ; |
22 | 29 |
160 CREATE TABLE wsts ( | 167 CREATE TABLE wsts ( |
161 id int PRIMARY KEY NOT NULL, | 168 id int PRIMARY KEY NOT NULL, |
162 river_id int NOT NULL REFERENCES rivers(id), | 169 river_id int NOT NULL REFERENCES rivers(id), |
163 description VARCHAR(256) NOT NULL, | 170 description VARCHAR(256) NOT NULL, |
164 kind int NOT NULL DEFAULT 0, | 171 kind int NOT NULL DEFAULT 0, |
172 unit_id int NOT NULL REFERENCES units(id), | |
165 -- TODO: more meta infos | 173 -- TODO: more meta infos |
166 UNIQUE (river_id, description) | 174 UNIQUE (river_id, description) |
167 ); | 175 ); |
168 | 176 |
169 -- columns of WST files | 177 -- columns of WST files |