Mercurial > dive4elements > river
diff flys-backend/ChangeLog @ 1192:5f8444df19e4
Add relations for cross sections.
flys-backend/trunk@2287 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Wed, 06 Jul 2011 10:23:45 +0000 |
parents | 1557cccb88f6 |
children | 1e3979e07b9e |
line wrap: on
line diff
--- a/flys-backend/ChangeLog Tue Jun 28 07:57:43 2011 +0000 +++ b/flys-backend/ChangeLog Wed Jul 06 10:23:45 2011 +0000 @@ -1,3 +1,38 @@ +2011-07-06 Sascha L. Teichmann <sascha.teichmann@intevation.de> + + * doc/schema/postgresql.sql: Add relations for cross sections. + To update existing databases: + BEGIN; + + CREATE SEQUENCE CROSS_SECTIONS_ID_SEQ; + CREATE TABLE cross_sections ( + id int PRIMARY KEY NOT NULL, + km NUMERIC NOT NULL, + river_id int NOT NULL REFERENCES rivers(id), + time_interval_id int REFERENCES time_intervals(id), + UNIQUE (km, river_id) + ); + + CREATE SEQUENCE POINTS3D_ID_SEQ; + CREATE TABLE points3d ( + id int PRIMARY KEY NOT NULL, + x NUMERIC NOT NULL, + y NUMERIC NOT NULL, + z NUMERIC NOT NULL + ); + + CREATE SEQUENCE CROSS_SECTION_POINTS_ID_SEQ; + CREATE TABLE cross_section_points ( + id int PRIMARY KEY NOT NULL, + cross_section_id int NOT NULL REFERENCES cross_sections(id), + point3d_id int NOT NULL REFERENCES points3d(id), + col_pos int NOT NULL, + UNIQUE (cross_section_id, point3d_id, col_pos), + UNIQUE (cross_section_id, col_pos) + ); + + COMMIT; + 2011-06-28 Ingo Weinzierl <ingo@intevation.de> Tagged RELEASE 2.4