Commit 51cced19 authored by Sebastien Ponce's avatar Sebastien Ponce
Browse files

Don't drop triggers neither primary key indexes

parent 04f1cd29
......@@ -10,7 +10,6 @@ DROP SEQUENCE ids_seq;
/* indexes for optimizing queries */
DROP INDEX I_Id2Type_typeId;
DROP INDEX I_DiskServer_name;
DROP INDEX I_CastorFile_fileIdNsHost;
DROP INDEX I_DiskCopy_Castorfile;
DROP INDEX I_DiskCopy_FileSystem;
DROP INDEX I_TapeCopy_Castorfile;
......@@ -229,17 +228,6 @@ DROP TABLE DeviceGroupName;
DROP TABLE DiskPoolQuery;
DROP FUNCTION getTime;
DROP TRIGGER tr_FileSystem_Insert;
DROP TRIGGER tr_FileSystem_Delete;
DROP TRIGGER tr_Stream_Insert;
DROP TRIGGER tr_Stream_Delete;
DROP TRIGGER tr_Stream2TapeCopy_Insert;
DROP TRIGGER tr_Stream2TapeCopy_Delete;
DROP TRIGGER tr_TapeCopy_Update;
DROP TRIGGER tr_DiskCopy_Update;
DROP TRIGGER tr_TapeCopy_CastorFile;
DROP TRIGGER tr_DiskCopy_CastorFile;
DROP TRIGGER tr_Stream2TapeCopy_Stream;
DROP FUNCTION FileSystemRate;
DROP PROCEDURE makeSubRequestWait;
DROP PROCEDURE archiveSubReq;
......@@ -249,8 +237,6 @@ DROP PROCEDURE deleteOutOfDateRequests;
DROP PROCEDURE anyTapeCopyForStream;
DROP PROCEDURE updateFsFileOpened;
DROP PROCEDURE updateFsFileClosed;
DROP TRIGGER tr_DiskServer_Insert;
DROP TRIGGER tr_DiskServer_Delete;
DROP PROCEDURE updateFileSystemForJob;
DROP PROCEDURE bestTapeCopyForStream;
DROP PROCEDURE bestFileSystemForSegment;
......@@ -289,7 +275,6 @@ DROP FUNCTION nopinGCPolicy;
DROP FUNCTION nullGCPolicy;
DROP PROCEDURE garbageCollectFS;
DROP PROCEDURE defGarbageCollectFS;
DROP TRIGGER tr_FileSystem_Update;
DROP PROCEDURE internalStageQuery;
DROP PROCEDURE internalFullStageQuery;
DROP PROCEDURE fileNameStageQuery;
......
......@@ -31,8 +31,9 @@ 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
grep 'CREATE OR REPLACE' ${TMPDIR}/${TOPNS}/db/oracleTrailer.sql | grep -v 'TRIGGER' | grep -v I_CastorFile_fileIdNsHost | awk 'BEGIN { FS="[ (]+" } { print "DROP " $4, $5 ";" }' > ${TMPDIR}/${TOPNS}/db/oracleTrailer_drop.sql
grep 'CREATE OR REPLACE' ${TMPDIR}/${TOPNS}/db/postgresTrailer.sql | grep -v 'TRIGGER' | grep -v I_CastorFile_fileIdNsHost | awk 'BEGIN { FS="[ (]+" } { print "DROP " $4, $5 ";" }' > ${TMPDIR}/${TOPNS}/db/postgresTrailer_drop.sql
sed 's/^END;/END;\n\//' ${TMPDIR}/${TOPNS}/db/castor_oracle_create.sql | sed 's/^\(END castor[a-zA-Z]*;\)/\1\n\//' | sed 's/\(CREATE OR REPLACE TYPE .*\)$/\1\n\//' > ${TMPDIR}/${TOPNS}/db/castor_oracle_create.sqlplus
# hack to prevent Umbrello from overwriting the original XMI file
cp ${XMIFILE} ${TMPDIR}
......
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