# HG changeset patch # User Sascha L. Teichmann # Date 1357394751 -3600 # Node ID 20b6ebf23916c8476263718ca8b5d5140442db9d # Parent d9f1202cef785e199e5339e2a3e4c25c28704228 !!! FLYS backend schema change !!! Add column bfg_id column to discharge_tables. Alter existing databases with alter table discharge_tables add column bfg_id varchar(50); This column is now used to synchronize FLYS with the AFT database. diff -r d9f1202cef78 -r 20b6ebf23916 flys-backend/doc/schema/oracle.sql --- a/flys-backend/doc/schema/oracle.sql Sat Jan 05 14:52:55 2013 +0100 +++ b/flys-backend/doc/schema/oracle.sql Sat Jan 05 15:05:51 2013 +0100 @@ -91,6 +91,7 @@ CREATE TABLE discharge_tables ( id NUMBER(38,0) NOT NULL, description VARCHAR2(255), + bfg_id VARCHAR2(50), kind NUMBER(38,0), gauge_id NUMBER(38,0), time_interval_id NUMBER(38,0), diff -r d9f1202cef78 -r 20b6ebf23916 flys-backend/doc/schema/postgresql.sql --- a/flys-backend/doc/schema/postgresql.sql Sat Jan 05 14:52:55 2013 +0100 +++ b/flys-backend/doc/schema/postgresql.sql Sat Jan 05 15:05:51 2013 +0100 @@ -145,6 +145,7 @@ id int PRIMARY KEY NOT NULL, gauge_id int NOT NULL REFERENCES gauges(id), description VARCHAR(256) NOT NULL, + bfg_id VARCHAR(50), kind int NOT NULL DEFAULT 0, time_interval_id int REFERENCES time_intervals(id) diff -r d9f1202cef78 -r 20b6ebf23916 flys-backend/src/main/java/de/intevation/flys/importer/ImportDischargeTable.java --- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportDischargeTable.java Sat Jan 05 14:52:55 2013 +0100 +++ b/flys-backend/src/main/java/de/intevation/flys/importer/ImportDischargeTable.java Sat Jan 05 15:05:51 2013 +0100 @@ -87,7 +87,7 @@ List dischargeTables = query.list(); if (dischargeTables.isEmpty()) { - peer = new DischargeTable(gauge, description, kind, ti); + peer = new DischargeTable(gauge, description, null, kind, ti); session.save(peer); } else { diff -r d9f1202cef78 -r 20b6ebf23916 flys-backend/src/main/java/de/intevation/flys/model/DischargeTable.java --- a/flys-backend/src/main/java/de/intevation/flys/model/DischargeTable.java Sat Jan 05 14:52:55 2013 +0100 +++ b/flys-backend/src/main/java/de/intevation/flys/model/DischargeTable.java Sat Jan 05 15:05:51 2013 +0100 @@ -24,6 +24,7 @@ private Integer id; private Gauge gauge; private String description; + private String bfgId; private Integer kind; private TimeInterval timeInterval; @@ -34,17 +35,19 @@ } public DischargeTable(Gauge gauge) { - this(gauge, null, 0, null); + this(gauge, null, null, 0, null); } public DischargeTable( Gauge gauge, String description, + String bfgId, Integer kind, TimeInterval timeInterval ) { this.gauge = gauge; this.description = description; + this.bfgId = bfgId; this.kind = kind; this.timeInterval = timeInterval; } @@ -85,6 +88,15 @@ this.description = description; } + @Column(name = "bfg_id") + public String getBfgId() { + return bfgId; + } + + public void setBfgId(String bfgId) { + this.bfgId = bfgId; + } + @Column(name = "kind") public Integer getKind() { return kind;