[Dive4elements-commits] [PATCH] SCHEMA CHANGE: fixed constraints in MINFO and removed obsolete column

Wald Commits scm-commit at wald.intevation.org
Wed Mar 27 10:25:55 CET 2013


# HG changeset patch
# User Tom Gottfried <tom.gottfried at intevation.de>
# Date 1364376345 -3600
# Node ID b279f2d4bc7891847e88174bca04fdf66974e5c4
# Parent  7876163fc40ed04e1925f8ae0c14f2e89bec79d3
SCHEMA CHANGE: fixed constraints in MINFO and removed obsolete column

diff -r 7876163fc40e -r b279f2d4bc78 flys-backend/doc/schema/oracle-minfo.sql
--- a/flys-backend/doc/schema/oracle-minfo.sql	Wed Mar 27 10:09:23 2013 +0100
+++ b/flys-backend/doc/schema/oracle-minfo.sql	Wed Mar 27 10:25:45 2013 +0100
@@ -40,13 +40,13 @@
 CREATE TABLE bed_height_single (
     id                      NUMBER(38,0) NOT NULL,
     river_id                NUMBER(38,0) NOT NULL,
-    year                    NUMBER(38,0) NOT NULL,
-    sounding_width          NUMBER(38,0) NOT NULL,
+    year                    NUMBER(38,0),
+    sounding_width          NUMBER(38,0),
     type_id                 NUMBER(38,0) NOT NULL,
     location_system_id      NUMBER(38,0) NOT NULL,
     cur_elevation_model_id  NUMBER(38,0) NOT NULL,
     old_elevation_model_id  NUMBER(38,0),
-    range_id                NUMBER(38,0) NOT NULL,
+    range_id                NUMBER(38,0),
     evaluation_by           VARCHAR(255),
     description             VARCHAR(255),
     PRIMARY KEY(id),
@@ -69,7 +69,7 @@
     -- type_id                 NUMBER(38,0) NOT NULL,
     cur_elevation_model_id  NUMBER(38,0) NOT NULL,
     old_elevation_model_id  NUMBER(38,0),
-    range_id                NUMBER(38,0) NOT NULL,
+    range_id                NUMBER(38,0),
     evaluation_by           VARCHAR(255),
     description             VARCHAR(255),
     PRIMARY KEY(id),
@@ -283,7 +283,7 @@
     name                     VARCHAR(256) NOT NULL,
     river_id                 NUMBER(38)   NOT NULL,
     station                  NUMBER(38,3) NOT NULL,
-    range_id                 NUMBER(38)   NOT NULL,
+    range_id                 NUMBER(38),
     measurement_type         VARCHAR(64)  NOT NULL,
     riverside                VARCHAR(16),
     reference_gauge_id       NUMBER(38),
@@ -318,7 +318,6 @@
     id                       NUMBER(38,0) NOT NULL,
     sq_relation_id           NUMBER(38,0) NOT NULL,
     measurement_station_id   NUMBER(38,0) NOT NULL,
-    parameter                VARCHAR(16)  NOT NULL,
     fraction                 VARCHAR(32)  NOT NULL,
     a                        NUMBER(38,20) NOT NULL,
     b                        NUMBER(38,20) NOT NULL,
@@ -330,5 +329,5 @@
     cduan                    NUMBER(38,20),
     PRIMARY KEY (id),
     CONSTRAINT fk_sqr_id FOREIGN KEY (sq_relation_id) REFERENCES sq_relation(id),
-    CONSTRAINT fk_mstation_id FOREIGN KEY (m_station_id) REFERENCES measurement_station(id)
+    CONSTRAINT fk_mstation_id FOREIGN KEY (measurement_station_id) REFERENCES measurement_station(id)
 );
diff -r 7876163fc40e -r b279f2d4bc78 flys-backend/doc/schema/postgresql-minfo.sql
--- a/flys-backend/doc/schema/postgresql-minfo.sql	Wed Mar 27 10:09:23 2013 +0100
+++ b/flys-backend/doc/schema/postgresql-minfo.sql	Wed Mar 27 10:25:45 2013 +0100
@@ -40,13 +40,13 @@
 CREATE TABLE bed_height_single (
     id                      int NOT NULL,
     river_id                int NOT NULL,
-    year                    int NOT NULL,
-    sounding_width          int NOT NULL,
+    year                    int,
+    sounding_width          int,
     type_id                 int NOT NULL,
     location_system_id      int NOT NULL,
     cur_elevation_model_id  int NOT NULL,
     old_elevation_model_id  int,
-    range_id                int NOT NULL,
+    range_id                int,
     evaluation_by           VARCHAR(255),
     description             VARCHAR(255),
     PRIMARY KEY(id),
@@ -69,7 +69,7 @@
     -- type_id                 int NOT NULL,
     cur_elevation_model_id  int NOT NULL,
     old_elevation_model_id  int,
-    range_id                int NOT NULL,
+    range_id                int,
     evaluation_by           VARCHAR(255),
     description             VARCHAR(255),
     PRIMARY KEY(id),
@@ -283,7 +283,7 @@
     name                     VARCHAR(256) NOT NULL,
     river_id                 int          NOT NULL,
     station                  NUMERIC      NOT NULL,
-    range_id                 int          NOT NULL,
+    range_id                 int,
     measurement_type         VARCHAR(64)  NOT NULL,
     riverside                VARCHAR(16),
     reference_gauge_id       int,
@@ -318,7 +318,6 @@
     id                     int NOT NULL,
     sq_relation_id         int NOT NULL,
     measurement_station_id int NOT NULL,
-    parameter              VARCHAR(16)  NOT NULL,
     fraction               VARCHAR(32)  NOT NULL,
     a                      NUMERIC NOT NULL,
     b                      NUMERIC NOT NULL,
@@ -330,6 +329,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 (m_station_id) REFERENCES measurement_station(id)
+    CONSTRAINT fk_mstation_id FOREIGN KEY (measurement_station_id) REFERENCES measurement_station(id)
 );
 COMMIT;


More information about the Dive4elements-commits mailing list