Commit e058ed2f authored by Giuseppe Lo Presti's avatar Giuseppe Lo Presti
Browse files

Improved script to autogenerate DROP part of the SQL scripts.

parent 1ed4477b
......@@ -31,11 +31,14 @@ set TMPDIR=`mktemp /tmp/gencastor-XXXXXX`
rm -rf ${TMPDIR}
mkdir -p ${TMPDIR}/${TOPNS}/db
cp ${WORKDIR}/${TOPNS}/db/*.sql ${TMPDIR}/${TOPNS}/db/
grep 'CREATE OR REPLACE' ${TMPDIR}/${TOPNS}/db/oracleTrailer.sql | awk 'BEGIN { FS="[ (]+" } { print "DROP " $4, $5 ";" }' > ${TMPDIR}/${TOPNS}/db/oracleTrailer_drop.sql
grep 'CREATE OR REPLACE' ${TMPDIR}/${TOPNS}/db/postgresTrailer.sql | awk 'BEGIN { FS="[ (]+" } { print "DROP " $4, $5 ";" }' > ${TMPDIR}/${TOPNS}/db/postgresTrailer_drop.sql
/usr/bin/gencastor.bin -o ${TMPDIR} -c ${TOPNS} --nocrashhandler ${XMIFILE}
set pushdsilent
pushd ${TMPDIR}
rm -f ${TOPNS}/db/*Generated*
rm -f ${TOPNS}/db/*Trailer_drop*
foreach f (`find . -type f`)
#echo $f
if !(-f ${WORKDIR}/${f}) then
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment