# HG changeset patch # User Sascha L. Teichmann # Date 1310052019 0 # Node ID 44581b40b96872b36c8604b99b367b30508dd23e # Parent 4e1b475a8cba046bb0f6c0a40b7a2f02526423d2 Schema: Added description column to the cross section table flys-backend/trunk@2307 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 4e1b475a8cba -r 44581b40b968 flys-backend/ChangeLog --- a/flys-backend/ChangeLog Thu Jul 07 15:05:30 2011 +0000 +++ b/flys-backend/ChangeLog Thu Jul 07 15:20:19 2011 +0000 @@ -1,3 +1,19 @@ +2011-07-07 Sascha L. Teichmann + + * doc/schema/postgresql.sql: Dropped constraint that enforces the + uniquness of km and river. This is violated because there are + more than one sounding in different year at the same km of a river. + Added column 'description' to the cross section table to make it + human readable. + + To update existing databases: + + ALTER TABLE cross_sections DROP CONSTRAINT cross_sections_km_key; + ALTER TABLE cross_sections ADD COLUMN description VARCHAR(256); + + * src/main/java/de/intevation/flys/model/CrossSection.java: + Added the description column to the Hibernate model. + 2011-07-07 Sascha L. Teichmann * doc/schema/postgresql.sql: Dropped constraint that enforces the diff -r 4e1b475a8cba -r 44581b40b968 flys-backend/doc/schema/postgresql.sql --- a/flys-backend/doc/schema/postgresql.sql Thu Jul 07 15:05:30 2011 +0000 +++ b/flys-backend/doc/schema/postgresql.sql Thu Jul 07 15:20:19 2011 +0000 @@ -269,7 +269,7 @@ km NUMERIC NOT NULL, river_id int NOT NULL REFERENCES rivers(id), time_interval_id int REFERENCES time_intervals(id), - UNIQUE (km, river_id) -- XXX: Maybe too hard? + description VARCHAR(256) ); CREATE SEQUENCE CROSS_SECTION_POINTS_ID_SEQ; diff -r 4e1b475a8cba -r 44581b40b968 flys-backend/src/main/java/de/intevation/flys/model/CrossSection.java --- a/flys-backend/src/main/java/de/intevation/flys/model/CrossSection.java Thu Jul 07 15:05:30 2011 +0000 +++ b/flys-backend/src/main/java/de/intevation/flys/model/CrossSection.java Thu Jul 07 15:20:19 2011 +0000 @@ -26,6 +26,7 @@ private BigDecimal km; private River river; private TimeInterval timeInterval; + private String description; private List points; public CrossSection() { @@ -77,6 +78,15 @@ this.timeInterval = timeInterval; } + @Column(name = "description") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + @OneToMany @JoinColumn(name="cross_section_id") public List getPoints() {