[Dive4elements-commits] [PATCH] SCHEME CHANGE: Add measurement_station to oracle table and rename comment column

Wald Commits scm-commit at wald.intevation.org
Fri Mar 8 15:16:25 CET 2013


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1362752160 -3600
# Node ID 8667f629d23843872c8cf68bb91683a93ea61089
# Parent  31fd42400c8407ebb540b4597d00506a0f72ef2e
SCHEME CHANGE: Add measurement_station to oracle table and rename comment column
Comment is a reserved keyword in oracle. This also fixes a typo in the table
name of time_intervals.

diff -r 31fd42400c84 -r 8667f629d238 flys-backend/doc/schema/oracle-drop-minfo.sql
--- a/flys-backend/doc/schema/oracle-drop-minfo.sql	Fri Mar 08 13:06:40 2013 +0100
+++ b/flys-backend/doc/schema/oracle-drop-minfo.sql	Fri Mar 08 15:16:00 2013 +0100
@@ -42,6 +42,10 @@
 ALTER TABLE sq_relation DROP CONSTRAINT fk_sqr_tinterval_id;
 ALTER TABLE sq_relation DROP CONSTRAINT fk_sqr_river_id;
 ALTER TABLE sq_relation_value DROP CONSTRAINT fk_sqr_id;
+ALTER TABLE measurement_station DROP CONSTRAINT fk_ms_river_id;
+ALTER TABLE measurement_station DROP CONSTRAINT fk_ms_range_id;
+ALTER TABLE measurement_station DROP CONSTRAINT fk_ms_reference_gauge_id;
+ALTER TABLE measurement_station DROP CONSTRAINT fk_ms_observation_timerange_id;
 
 DROP TABLE bed_height_type;
 DROP TABLE location_system;
@@ -69,6 +73,7 @@
 DROP TABLE waterlevel_difference;
 DROP TABLE waterlevel_difference_column;
 DROP TABLE waterlevel_difference_values;
+DROP TABLE measurement_station;
 DROP TABLE sq_relation_value;
 DROP TABLE sq_relation;
 
diff -r 31fd42400c84 -r 8667f629d238 flys-backend/doc/schema/oracle-minfo.sql
--- a/flys-backend/doc/schema/oracle-minfo.sql	Fri Mar 08 13:06:40 2013 +0100
+++ b/flys-backend/doc/schema/oracle-minfo.sql	Fri Mar 08 15:16:00 2013 +0100
@@ -353,6 +353,28 @@
 );
 
 
+CREATE SEQUENCE MEASUREMENT_STATION_ID_SEQ;
+CREATE TABLE measurement_station (
+    id                       NUMBER(38)   NOT NULL,
+    name                     VARCHAR(256) NOT NULL,
+    river_id                 NUMBER(38)   NOT NULL,
+    station                  NUMBER(38,3) NOT NULL,
+    range_id                 NUMBER(38)   NOT NULL,
+    measurement_type         VARCHAR(64)  NOT NULL,
+    riverside                VARCHAR(16),
+    reference_gauge_id       NUMBER(38),
+    observation_timerange_id NUMBER(38),
+    operator                 VARCHAR(64),
+    description              VARCHAR(512),
+    PRIMARY KEY              (id),
+    CONSTRAINT fk_ms_river_id FOREIGN KEY (river_id) REFERENCES rivers(id) ON DELETE CASCADE,
+    CONSTRAINT fk_ms_range_id FOREIGN KEY (range_id) REFERENCES ranges(id) ON DELETE CASCADE,
+    CONSTRAINT fk_ms_reference_gauge_id FOREIGN KEY (reference_gauge_id) REFERENCES gauges(id) ON DELETE CASCADE,
+    CONSTRAINT fk_ms_observation_timerange_id FOREIGN KEY (observation_timerange_id) REFERENCES time_intervals(id),
+    UNIQUE (river_id, station)
+);
+
+
 CREATE SEQUENCE SQ_RELATION_ID_SEQ;
 
 CREATE TABLE sq_relation (
diff -r 31fd42400c84 -r 8667f629d238 flys-backend/doc/schema/oracle.sql
--- a/flys-backend/doc/schema/oracle.sql	Fri Mar 08 13:06:40 2013 +0100
+++ b/flys-backend/doc/schema/oracle.sql	Fri Mar 08 15:16:00 2013 +0100
@@ -261,7 +261,7 @@
 -- TIME_INTERVALS
 CREATE SEQUENCE TIME_INTERVALS_ID_SEQ;
 
-CREATE TABLE time_intervals_ (
+CREATE TABLE time_intervals (
     id                  NUMBER(38,0) NOT NULL, 
     start_time          TIMESTAMP NOT NULL,
     stop_time           TIMESTAMP,
diff -r 31fd42400c84 -r 8667f629d238 flys-backend/doc/schema/postgresql-minfo.sql
--- a/flys-backend/doc/schema/postgresql-minfo.sql	Fri Mar 08 13:06:40 2013 +0100
+++ b/flys-backend/doc/schema/postgresql-minfo.sql	Fri Mar 08 15:16:00 2013 +0100
@@ -285,23 +285,23 @@
 
 CREATE SEQUENCE MEASUREMENT_STATION_ID_SEQ;
 CREATE TABLE measurement_station (
-	id			             int          NOT NULL,
-	name		             VARCHAR(256) NOT NULL,
-	river_id                 int          NOT NULL,
-	station                  NUMERIC      NOT NULL,
-	range_id                 int          NOT NULL,
-	measurement_type         VARCHAR(64)  NOT NULL,
-	riverside                VARCHAR(16),
-	reference_gauge_id       int,
-	observation_timerange_id int,
-	operator				 VARCHAR(64),
-	comment					 VARCHAR(512),
-	PRIMARY KEY (id),
-	CONSTRAINT fk_ms_river_id FOREIGN KEY (river_id) REFERENCES rivers(id) ON DELETE CASCADE,
-	CONSTRAINT fk_ms_range_id FOREIGN KEY (range_id) REFERENCES ranges(id) ON DELETE CASCADE,
-	CONSTRAINT fk_ms_reference_gauge_id FOREIGN KEY (reference_gauge_id) REFERENCES gauges(id) ON DELETE CASCADE,
-	CONSTRAINT fk_ms_observation_timerange_id FOREIGN KEY (observation_timerange_id) REFERENCES time_intervals(id),
-	UNIQUE (river_id, station)
+    id                       int          NOT NULL,
+    name                     VARCHAR(256) NOT NULL,
+    river_id                 int          NOT NULL,
+    station                  NUMERIC      NOT NULL,
+    range_id                 int          NOT NULL,
+    measurement_type         VARCHAR(64)  NOT NULL,
+    riverside                VARCHAR(16),
+    reference_gauge_id       int,
+    observation_timerange_id int,
+    operator                 VARCHAR(64),
+    description              VARCHAR(512),
+    PRIMARY KEY (id),
+    CONSTRAINT fk_ms_river_id FOREIGN KEY (river_id) REFERENCES rivers(id) ON DELETE CASCADE,
+    CONSTRAINT fk_ms_range_id FOREIGN KEY (range_id) REFERENCES ranges(id) ON DELETE CASCADE,
+    CONSTRAINT fk_ms_reference_gauge_id FOREIGN KEY (reference_gauge_id) REFERENCES gauges(id) ON DELETE CASCADE,
+    CONSTRAINT fk_ms_observation_timerange_id FOREIGN KEY (observation_timerange_id) REFERENCES time_intervals(id),
+    UNIQUE (river_id, station)
 );
 
 
diff -r 31fd42400c84 -r 8667f629d238 flys-backend/src/main/java/de/intevation/flys/model/MeasurementStation.java
--- a/flys-backend/src/main/java/de/intevation/flys/model/MeasurementStation.java	Fri Mar 08 13:06:40 2013 +0100
+++ b/flys-backend/src/main/java/de/intevation/flys/model/MeasurementStation.java	Fri Mar 08 15:16:00 2013 +0100
@@ -21,7 +21,7 @@
     private String measurementType;
     private String riverside;
     private String operator;
-    private String comment;
+    private String description;
 
     private Double station;
     private Range range;
@@ -37,7 +37,7 @@
 
     public MeasurementStation(River river, String name, String measurementType,
         String riverside, Double station, Range range, Gauge gauge,
-        TimeInterval observationTimerange, String operator, String comment) {
+        TimeInterval observationTimerange, String operator, String description) {
         this.river = river;
         this.name = name;
         this.measurementType = measurementType;
@@ -47,7 +47,7 @@
         this.gauge = gauge;
         this.observationTimerange = observationTimerange;
         this.operator = operator;
-        this.comment = comment;
+        this.description = description;
     }
 
     @Id
@@ -147,13 +147,13 @@
         this.operator = operator;
     }
 
-    @Column(name = "comment")
-    public String getComment() {
-        return comment;
+    @Column(name = "description")
+    public String getDescription() {
+        return description;
     }
 
-    public void setComment(String comment) {
-        this.comment = comment;
+    public void setDescription(String description) {
+        this.description = description;
     }
 
 }


More information about the Dive4elements-commits mailing list