-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into bugs/re-enable-sync
- Loading branch information
Showing
203 changed files
with
14,254 additions
and
1,404 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
source/database/mssql/scripts/dbscripts/MSSQL_Script_Footer.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
If XACT_STATE()=1 | ||
BEGIN | ||
PRINT 'Committing Tranaction...' | ||
COMMIT TRANSACTION | ||
END | ||
ELSE IF XACT_STATE()=-1 | ||
BEGIN | ||
PRINT 'Rolling Back Transaction...' | ||
ROLLBACK TRANSACTION | ||
END |
4 changes: 4 additions & 0 deletions
4
source/database/mssql/scripts/dbscripts/MSSQL_Script_Header.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
:On Error Exit | ||
SET XACT_ABORT ON | ||
GO | ||
BEGIN TRANSACTION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
source "run_sql_scripts.sh" -f "C:\WorkPIMS\PSP_PIMS_S89_00" -s "\Alter Up" |
45 changes: 45 additions & 0 deletions
45
source/database/mssql/scripts/dbscripts/run_sql_scripts.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/bash | ||
|
||
# Retrieve the parameters passed | ||
while getopts f:s: option | ||
do | ||
case "${option}" | ||
in | ||
f)FOLDER=${OPTARG};; | ||
s)SUBFOLDER=${OPTARG};; | ||
esac | ||
done | ||
|
||
# Set your output file | ||
SQLFOLDER=${FOLDER}${SUBFOLDER} | ||
FILE=${FOLDER}${SUBFOLDER}'\master.sql' | ||
SCRIPTHOME=${PWD} | ||
|
||
echo $SQLFOLDER | ||
echo $FILE | ||
echo $SCRIPTHOME | ||
|
||
# Initialize the destination file | ||
cp 'MSSQL_Script_Header.txt' "$FILE" | ||
echo >> "$FILE" | ||
|
||
# exit 0 | ||
|
||
cd "$SQLFOLDER" | ||
|
||
# Enable extended globbing | ||
shopt -s extglob nullglob | ||
|
||
# Loop through all SQL files in the current directory | ||
for sql_file in !(master).sql | ||
do | ||
echo 'Running $sql_file...' $sql_file | ||
echo "PRINT 'Executing" $sql_file "'" >> "$FILE" | ||
echo ':r' $sql_file >> "$FILE" | ||
done | ||
|
||
cd $SCRIPTHOME | ||
|
||
# Finalize the destination file | ||
echo >> "$FILE" | ||
cat 'MSSQL_Script_Footer.txt' >> "$FILE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.