[Dive4elements-commits] [PATCH] Schema change: fixed constraints

Wald Commits scm-commit at wald.intevation.org
Fri Apr 12 16:13:27 CEST 2013


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1365776003 -7200
# Node ID 88cbe798cbab44c21b66887bd99a28967bfdfcb3
# Parent  545a6ace9a19b243b7560d6922153b6b089f1851
Schema change: fixed constraints

diff -r 545a6ace9a19 -r 88cbe798cbab flys-backend/doc/schema/oracle-minfo.sql
--- a/flys-backend/doc/schema/oracle-minfo.sql	Fri Apr 12 15:08:14 2013 +0200
+++ b/flys-backend/doc/schema/oracle-minfo.sql	Fri Apr 12 16:13:23 2013 +0200
@@ -331,5 +331,5 @@
     cduan                    NUMBER(38,20),
     PRIMARY KEY (id),
     CONSTRAINT fk_sqr_id FOREIGN KEY (sq_relation_id) REFERENCES sq_relation(id) ON DELETE CASCADE,
-    CONSTRAINT fk_mstation_id FOREIGN KEY (measurement_station_id) REFERENCES measurement_station(id)
+    CONSTRAINT fk_mstation_id FOREIGN KEY (measurement_station_id) REFERENCES measurement_station(id) ON DELETE CASCADE
 );
diff -r 545a6ace9a19 -r 88cbe798cbab flys-backend/doc/schema/oracle.sql
--- a/flys-backend/doc/schema/oracle.sql	Fri Apr 12 15:08:14 2013 +0200
+++ b/flys-backend/doc/schema/oracle.sql	Fri Apr 12 16:13:23 2013 +0200
@@ -220,7 +220,7 @@
 
 CREATE TABLE named_main_values (
     id                  NUMBER(38,0) NOT NULL,
-    name                VARCHAR2(255),
+    name                VARCHAR2(256) NOT NULL UNIQUE,
     type_id             NUMBER(38,0),
     PRIMARY KEY (id)
 );
diff -r 545a6ace9a19 -r 88cbe798cbab flys-backend/doc/schema/postgresql-minfo.sql
--- a/flys-backend/doc/schema/postgresql-minfo.sql	Fri Apr 12 15:08:14 2013 +0200
+++ b/flys-backend/doc/schema/postgresql-minfo.sql	Fri Apr 12 16:13:23 2013 +0200
@@ -331,6 +331,6 @@
     cduan                  NUMERIC,
     PRIMARY KEY (id),
     CONSTRAINT fk_sqr_id FOREIGN KEY (sq_relation_id) REFERENCES sq_relation(id) ON DELETE CASCADE,
-    CONSTRAINT fk_mstation_id FOREIGN KEY (measurement_station_id) REFERENCES measurement_station(id)
+    CONSTRAINT fk_mstation_id FOREIGN KEY (measurement_station_id) REFERENCES measurement_station(id) ON DELETE CASCADE
 );
 COMMIT;
diff -r 545a6ace9a19 -r 88cbe798cbab flys-backend/doc/schema/postgresql.sql
--- a/flys-backend/doc/schema/postgresql.sql	Fri Apr 12 15:08:14 2013 +0200
+++ b/flys-backend/doc/schema/postgresql.sql	Fri Apr 12 16:13:23 2013 +0200
@@ -111,8 +111,7 @@
 CREATE TABLE named_main_values (
     id      int PRIMARY KEY NOT NULL,
     name    VARCHAR(256)    NOT NULL UNIQUE,
-    type_id int NOT NULL REFERENCES main_value_types(id),
-    UNIQUE (name, type_id)
+    type_id int NOT NULL REFERENCES main_value_types(id)
 );
 
 -- Table for time intervals


More information about the Dive4elements-commits mailing list