Issue #2038 Fixes for 13.5.1 delta scripts

Former-commit-id: 41ead90acf0d06e959e513e5a25869eb6e18150a
This commit is contained in:
Dustin Johnson 2013-06-11 13:07:14 -05:00
parent 208d1439ac
commit bac07c65a1
4 changed files with 87 additions and 17 deletions

View file

@ -0,0 +1,23 @@
#!/bin/bash
SQL_SCRIPT="changeDataTypeEnumToUppercase.sql"
# ensure that the sql script is present
if [ ! -f ${SQL_SCRIPT} ]; then
echo "ERROR: the required sql script - ${SQL_SCRIPT} was not found."
echo "FATAL: the update has failed!"
exit 1
fi
echo "INFO: update started - changing DataType to an Uppercase enum"
# run the update
/awips2/psql/bin/psql -U awips -d metadata -f ${SQL_SCRIPT}
if [ $? -ne 0 ]; then
echo "FATAL: the update has failed!"
exit 1
fi
echo "INFO: the update has completed successfully!"
exit 0

View file

@ -0,0 +1,32 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
\set ON_ERROR_STOP 1
\connect metadata;
-- Start a transaction
BEGIN;
-- Update dataSetType="Grid" references to dataSetType="GRID"
update ebxml.value set stringvalue = regexp_replace(stringvalue, 'dataSetType="Grid"', 'dataSetType="GRID"', 'g');
-- Update dataType="Grid" references to dataType="GRID"
update ebxml.value set stringvalue = regexp_replace(stringvalue, 'dataType="Grid"', 'dataType="GRID"', 'g');
-- Commit the transaction
END;

View file

@ -8,23 +8,7 @@ if [ ! -f ${XSLT_SCRIPT} ]; then
exit 1
fi
echo "INFO: update started - updating ProviderType to be a class proper"
# Update subscription manager configuration files
for FILE in `find /awips2/edex/data/utility/common_static -iname \*-harvester.xml`
do
cp $FILE $FILE.bak
xsltproc ${XSLT_SCRIPT} ${FILE}.bak > ${FILE}
# Make sure each command succeeds
if [ $? -ne 0 ]; then
echo "FATAL: the update has failed!"
exit 1
fi
# Delete the md5 file
rm $FILE.md5
done
echo "INFO: update started - updating ProviderType to be a class proper in the database"
# Dump the provider rows from the database for modification
PROVIDER_ROWS=/tmp/provider_rows.tmp

View file

@ -0,0 +1,31 @@
#!/bin/bash
XSLT_SCRIPT="updateProviderType.xsl"
# ensure that the xslt script is present
if [ ! -f ${XSLT_SCRIPT} ]; then
echo "ERROR: the required xslt script - ${XSLT_SCRIPT} was not found."
echo "FATAL: the update has failed!"
exit 1
fi
echo "INFO: update started - updating ProviderType to be a class proper in localization files"
# Update subscription manager configuration files
for FILE in `find /awips2/edex/data/utility/common_static -iname \*-harvester.xml`
do
cp $FILE $FILE.bak
xsltproc ${XSLT_SCRIPT} ${FILE}.bak > ${FILE}
# Make sure each command succeeds
if [ $? -ne 0 ]; then
echo "FATAL: the update has failed!"
exit 1
fi
# Delete the md5 file
rm $FILE.md5
done
echo "INFO: the update has completed successfully!"
exit 0