Issue #2581 add dataURI back to LocalStormReport for 14.2.1, fix RAIN
events while in there Change-Id: I678035f35aef0153fdc92b935bad4372d77d3619 Former-commit-id:c18e66cc45
[formerly327c588c9e
] [formerlyc18e66cc45
[formerly327c588c9e
] [formerly906c679b4e
[formerly 68de7dd0f4e5728cb077dad541ef9369627fced4]]] Former-commit-id:906c679b4e
Former-commit-id:af0ac40f47
[formerly7bd1d802be
] Former-commit-id:ed91c1d6f5
This commit is contained in:
parent
6953e81887
commit
cfb4bdbb21
3 changed files with 44 additions and 3 deletions
29
deltaScripts/14.2.1/undoDropLSRdataURI.sh
Normal file
29
deltaScripts/14.2.1/undoDropLSRdataURI.sh
Normal 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"
|
|
@ -37,6 +37,7 @@ import java.util.Map;
|
||||||
* Jan 03, 2014 2581 njensen Added coastal flood
|
* Jan 03, 2014 2581 njensen Added coastal flood
|
||||||
* Jan 13, 2014 2581 njensen Added debris flow
|
* Jan 13, 2014 2581 njensen Added debris flow
|
||||||
* Jan 17, 2014 2581 njensen Added blowing snow
|
* Jan 17, 2014 2581 njensen Added blowing snow
|
||||||
|
* Jan 30, 2014 2581 njensen Added rain
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -89,7 +90,8 @@ public enum LSREventType {
|
||||||
FREEZINGDRIZZLE("FREEZING DRIZZLE", 40, LSRUnits.NOUNITS),
|
FREEZINGDRIZZLE("FREEZING DRIZZLE", 40, LSRUnits.NOUNITS),
|
||||||
COASTALFLOOD("COASTAL FLOOD", 41, LSRUnits.NOUNITS),
|
COASTALFLOOD("COASTAL FLOOD", 41, LSRUnits.NOUNITS),
|
||||||
DEBRISFLOW("DEBRIS FLOW", 42, 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
|
// TODO contemplate storing the event type as a string in the database instead of an enum/integer
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,8 @@ import javax.measure.quantity.Velocity;
|
||||||
import javax.measure.unit.NonSI;
|
import javax.measure.unit.NonSI;
|
||||||
import javax.measure.unit.SI;
|
import javax.measure.unit.SI;
|
||||||
import javax.measure.unit.Unit;
|
import javax.measure.unit.Unit;
|
||||||
|
import javax.persistence.Access;
|
||||||
|
import javax.persistence.AccessType;
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Embedded;
|
import javax.persistence.Embedded;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
|
@ -70,6 +72,7 @@ import com.vividsolutions.jts.geom.Geometry;
|
||||||
* Oct 14, 2013 2361 njensen Removed XML annotations and IDecoderGettable
|
* Oct 14, 2013 2361 njensen Removed XML annotations and IDecoderGettable
|
||||||
* Dec 10, 2013 2581 njensen Removed dataURI column
|
* Dec 10, 2013 2581 njensen Removed dataURI column
|
||||||
* Jan 15, 2014 2581 njensen Changed constraint to use officeId instead of stationId
|
* Jan 15, 2014 2581 njensen Changed constraint to use officeId instead of stationId
|
||||||
|
* Jan 30, 2014 2581 njensen Added dataURI column back in
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -79,8 +82,8 @@ import com.vividsolutions.jts.geom.Geometry;
|
||||||
@Entity
|
@Entity
|
||||||
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "lsrseq")
|
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "lsrseq")
|
||||||
@Table(name = "lsr", uniqueConstraints = { @UniqueConstraint(columnNames = {
|
@Table(name = "lsr", uniqueConstraints = { @UniqueConstraint(columnNames = {
|
||||||
"latitude", "longitude", "officeId", "refTime", "forecastTime",
|
// "latitude", "longitude", "officeId", "refTime", "forecastTime", "eventType"
|
||||||
"eventType" }) })
|
"dataURI" }) })
|
||||||
/*
|
/*
|
||||||
* Both refTime and forecastTime are included in the refTimeIndex since
|
* Both refTime and forecastTime are included in the refTimeIndex since
|
||||||
* forecastTime is unlikely to be used.
|
* forecastTime is unlikely to be used.
|
||||||
|
@ -509,4 +512,11 @@ public class LocalStormReport extends PersistablePluginDataObject implements
|
||||||
public String getPluginName() {
|
public String getPluginName() {
|
||||||
return "lsr";
|
return "lsr";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Column
|
||||||
|
@Access(AccessType.PROPERTY)
|
||||||
|
public String getDataURI() {
|
||||||
|
return super.getDataURI();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue