Issue #2581 add dataURI back to LocalStormReport for 14.2.1, fix RAIN

events while in there

Change-Id: I678035f35aef0153fdc92b935bad4372d77d3619

Former-commit-id: 9ff86044a2 [formerly c18e66cc45] [formerly 327c588c9e] [formerly 9ff86044a2 [formerly c18e66cc45] [formerly 327c588c9e] [formerly 906c679b4e [formerly 327c588c9e [formerly 68de7dd0f4e5728cb077dad541ef9369627fced4]]]]
Former-commit-id: 906c679b4e
Former-commit-id: 53afb531fa [formerly af0ac40f47] [formerly a60314b3783b7851cffad12a2adc0d68ac6ecdb3 [formerly 7bd1d802be]]
Former-commit-id: 21c2189b9de73879ebb7e4c047f7d7c980d4918a [formerly ed91c1d6f5]
Former-commit-id: cfb4bdbb21
This commit is contained in:
Nate Jensen 2014-01-30 11:56:16 -06:00
parent de4a452a07
commit ab58b2f973
3 changed files with 44 additions and 3 deletions

View file

@ -0,0 +1,29 @@
#!/bin/bash
# DR #2581 - This update script will add the dataURI column to the lsr table
# The column needs to be there for 14.2.1.
# Only run this if you have already run dropLSRdataURI.sh, otherwise
# don't run this script or that one.
PSQL="/awips2/psql/bin/psql"
# adds the datauri constraint and column
function addDataUriLSR {
echo "INFO: Adding DataURI column to lsr"
${PSQL} -U awips -d metadata -c "ALTER TABLE lsr DROP CONSTRAINT IF EXISTS lsr_latitude_longitude_stationId_reftime_forecasttime_eventtype;"
${PSQL} -U awips -d metadata -c "ALTER TABLE lsr ADD COLUMN datauri varchar(255);"
${PSQL} -U awips -d metadata -c "ALTER TABLE lsr ADD CONSTRAINT lsr_datauri_key UNIQUE (datauri);"
if [ $? -ne 0 ]; then
echo "ERROR: Failed to repair dataURI for lsr"
echo "FATAL: The update has failed."
exit 1
fi
}
echo "INFO: Adding LSR dataURI column back in."
addDataUriLSR
echo "INFO: LSR dataURI column added successfully"

View file

@ -37,6 +37,7 @@ import java.util.Map;
* Jan 03, 2014 2581 njensen Added coastal flood
* Jan 13, 2014 2581 njensen Added debris flow
* Jan 17, 2014 2581 njensen Added blowing snow
* Jan 30, 2014 2581 njensen Added rain
*
* </pre>
*
@ -89,7 +90,8 @@ public enum LSREventType {
FREEZINGDRIZZLE("FREEZING DRIZZLE", 40, LSRUnits.NOUNITS),
COASTALFLOOD("COASTAL FLOOD", 41, LSRUnits.NOUNITS),
DEBRISFLOW("DEBRIS FLOW", 42, LSRUnits.NOUNITS),
BLOWINGSNOW("BLOWING SNOW", 43, LSRUnits.NOUNITS);
BLOWINGSNOW("BLOWING SNOW", 43, LSRUnits.NOUNITS),
RAIN("RAIN", 44, LSRUnits.NOUNITS);
// TODO contemplate storing the event type as a string in the database instead of an enum/integer

View file

@ -30,6 +30,8 @@ import javax.measure.quantity.Velocity;
import javax.measure.unit.NonSI;
import javax.measure.unit.SI;
import javax.measure.unit.Unit;
import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
@ -70,6 +72,7 @@ import com.vividsolutions.jts.geom.Geometry;
* Oct 14, 2013 2361 njensen Removed XML annotations and IDecoderGettable
* Dec 10, 2013 2581 njensen Removed dataURI column
* Jan 15, 2014 2581 njensen Changed constraint to use officeId instead of stationId
* Jan 30, 2014 2581 njensen Added dataURI column back in
*
* </pre>
*
@ -79,8 +82,8 @@ import com.vividsolutions.jts.geom.Geometry;
@Entity
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "lsrseq")
@Table(name = "lsr", uniqueConstraints = { @UniqueConstraint(columnNames = {
"latitude", "longitude", "officeId", "refTime", "forecastTime",
"eventType" }) })
// "latitude", "longitude", "officeId", "refTime", "forecastTime", "eventType"
"dataURI" }) })
/*
* Both refTime and forecastTime are included in the refTimeIndex since
* forecastTime is unlikely to be used.
@ -509,4 +512,11 @@ public class LocalStormReport extends PersistablePluginDataObject implements
public String getPluginName() {
return "lsr";
}
@Override
@Column
@Access(AccessType.PROPERTY)
public String getDataURI() {
return super.getDataURI();
}
}