Merge "Issue #2581 add dataURI back to LocalStormReport for 14.2.1, fix RAIN events while in there" into omaha_14.2.1
Former-commit-id:5ad9cca7a3
[formerly 4df9504e742c2807676521b10e56797fb3a24a68] Former-commit-id:ed0c724860
This commit is contained in:
commit
7fbfe85478
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 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
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue