Mercurial > dive4elements > river
comparison flys-backend/doc/schema/postgresql.sql @ 5300:a82b621d87b0
merge
author | Bettina Gruenbauer <bettina@intevation.de> |
---|---|
date | Thu, 14 Mar 2013 14:36:32 +0100 |
parents | eaa630838705 |
children | 6dd354e7abfc |
comparison
equal
deleted
inserted
replaced
5299:bede56860646 | 5300:a82b621d87b0 |
---|---|
34 river_id int NOT NULL REFERENCES rivers(id) ON DELETE CASCADE, | 34 river_id int NOT NULL REFERENCES rivers(id) ON DELETE CASCADE, |
35 a NUMERIC NOT NULL, | 35 a NUMERIC NOT NULL, |
36 b NUMERIC, | 36 b NUMERIC, |
37 UNIQUE (river_id, a, b) | 37 UNIQUE (river_id, a, b) |
38 ); | 38 ); |
39 ALTER TABLE ranges ALTER COLUMN id SET DEFAULT NEXTVAL('RANGES_ID_SEQ'); | |
40 | |
39 | 41 |
40 -- Lage 'links', 'rechts', etc. | 42 -- Lage 'links', 'rechts', etc. |
41 CREATE SEQUENCE POSITIONS_ID_SEQ; | 43 CREATE SEQUENCE POSITIONS_ID_SEQ; |
42 | 44 |
43 CREATE TABLE positions ( | 45 CREATE TABLE positions ( |
121 id int PRIMARY KEY NOT NULL, | 123 id int PRIMARY KEY NOT NULL, |
122 start_time TIMESTAMP NOT NULL, | 124 start_time TIMESTAMP NOT NULL, |
123 stop_time TIMESTAMP, | 125 stop_time TIMESTAMP, |
124 CHECK (start_time <= stop_time) | 126 CHECK (start_time <= stop_time) |
125 ); | 127 ); |
128 ALTER TABLE time_intervals ALTER COLUMN id SET DEFAULT NEXTVAL('TIME_INTERVALS_ID_SEQ'); | |
129 | |
126 | 130 |
127 -- Stammdaten | 131 -- Stammdaten |
128 CREATE SEQUENCE MAIN_VALUES_ID_SEQ; | 132 CREATE SEQUENCE MAIN_VALUES_ID_SEQ; |
129 | 133 |
130 CREATE TABLE main_values ( | 134 CREATE TABLE main_values ( |