changeset 1226:1dbafbba50ea

Schema: added missing key contraint on hyks table. flys-backend/trunk@2359 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 19 Jul 2011 10:10:51 +0000
parents d859c4bc6ace
children cdb35d96ca09
files flys-backend/ChangeLog flys-backend/doc/schema/postgresql.sql
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/flys-backend/ChangeLog	Mon Jul 18 16:55:32 2011 +0000
+++ b/flys-backend/ChangeLog	Tue Jul 19 10:10:51 2011 +0000
@@ -1,3 +1,10 @@
+2011-07-18	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* doc/schema/postgresql.sql: Added missing foreign key contraint on hyks table.
+	  To update existing databases:
+
+	  ALTER TABLE hyks ADD CONSTRAINT hyks_river_id_fkey FOREIGN KEY (river_id) REFERENCES rivers(id);
+
 2011-07-18	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* src/main/java/de/intevation/flys/importer/parsers/HYKParser.java:
--- a/flys-backend/doc/schema/postgresql.sql	Mon Jul 18 16:55:32 2011 +0000
+++ b/flys-backend/doc/schema/postgresql.sql	Tue Jul 19 10:10:51 2011 +0000
@@ -297,7 +297,7 @@
 
 CREATE TABLE hyks (
     id          int PRIMARY KEY NOT NULL,
-    river_id    int             NOT NULL,
+    river_id    int             NOT NULL REFERENCES rivers(id),
     description VARCHAR(256)    NOT NULL
 );
 

http://dive4elements.wald.intevation.org