maps-database will now update itself same as ncep-database
This commit is contained in:
parent
27742c8403
commit
b8053833f1
1 changed files with 46 additions and 55 deletions
|
@ -42,9 +42,7 @@ if [ $? -ne 0 ]; then
|
|||
fi
|
||||
|
||||
# Copy the sql that is needed to create the maps database.
|
||||
PATH_TO_DDL="build.edex/opt/db/ddl"
|
||||
PATH_TO_MAPS_DDL="${PATH_TO_DDL}/maps"
|
||||
cp -r %{_baseline_workspace}/${PATH_TO_MAPS_DDL}/* \
|
||||
cp -r %{_baseline_workspace}/build.edex/opt/db/ddl/maps/* \
|
||||
${RPM_BUILD_ROOT}/awips2/database/sqlScripts/share/sql/maps
|
||||
|
||||
PATH_TO_STATIC_DDL="%{_awipscm_share}/awips2-static/maps/db"
|
||||
|
@ -130,17 +128,11 @@ else
|
|||
fi
|
||||
|
||||
# Is there a maps database?
|
||||
MAPS_DB_EXISTS="false"
|
||||
MAPS_DB=`${PSQL} -U awips -l | grep maps | awk '{print $1}'`
|
||||
if [ "${MAPS_DB}" = "maps" ]; then
|
||||
MAPS_DB_EXISTS="true"
|
||||
# We Have a Maps Database, There Is Nothing To Do.
|
||||
fi
|
||||
|
||||
if [ "${MAPS_DB_EXISTS}" = "false" ]; then
|
||||
# Create the maps directory; remove any existing directories.
|
||||
if [ -d /awips2/data/maps ]; then
|
||||
su - ${DB_OWNER} -c "rm -rf /awips2/data/maps"
|
||||
su - ${DB_OWNER} -c "rm -rf /awips2/data/maps" # seems like this is what we want to do...
|
||||
fi
|
||||
su - ${DB_OWNER} -c "mkdir -p /awips2/data/maps"
|
||||
|
||||
|
@ -185,7 +177,6 @@ if [ "${MAPS_DB_EXISTS}" = "false" ]; then
|
|||
su - ${DB_OWNER} -c \
|
||||
"${PG_RESTORE} -d maps -U awips -p 5432 -n public -t geometry_columns -a ${DB_ARCHIVE}" \
|
||||
>> ${SQL_LOG} 2>&1
|
||||
fi
|
||||
|
||||
# stop PostgreSQL if we started it.
|
||||
if [ "${I_STARTED_POSTGRESQL}" = "YES" ]; then
|
||||
|
|
Loading…
Add table
Reference in a new issue