Skip to content

Commit

Permalink
DB Scripts - Fix alphanumeric sorting for folders S100 and greater (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
asanchezr authored Feb 18, 2025
1 parent 751f773 commit 60fb76e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion source/database/mssql/scripts/dbscripts/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
eval $(grep -v '^#' ../../.env | xargs)
NEWEST_PSP_DIR=$(find ./*PSP* -type d -prune | tail -n 1 | cut -c 3-)
NEWEST_PSP_DIR=$(find ./*PSP* -type d -prune | sort -V | tail -n 1 | cut -c 3-)
TARGET_SPRINT="${TARGET_SPRINT:-$NEWEST_PSP_DIR}"
echo "* Executing scripts in $TARGET_SPRINT against server $SERVER_NAME database name $DB_NAME as user $DB_USER. Continue with Deployment (Y/N)"
read -n 1 -r
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ then
generate_file "$TARGET_SPRINT/Alter Up"
generate_file "$TARGET_SPRINT/Alter Down"
else
NEWEST_PSP_DIR=$(find ./*PSP* -type d -prune | tail -n 1 | cut -c 3-)
NEWEST_PSP_DIR=$(find ./*PSP* -type d -prune | sort -V | tail -n 1 | cut -c 3-)
generate_file "$NEWEST_PSP_DIR/Alter Up"
generate_file "$NEWEST_PSP_DIR/Alter Down"
fi
Expand Down
2 changes: 1 addition & 1 deletion source/database/mssql/scripts/dbscripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ echo "======= MSSQL SERVER STARTED ========"

echo "======= MSSQL CONFIG COMPLETE ======="

NEWEST_PSP_DIR=$(find ./*PSP* -type d -prune | tail -n 1 | cut -c 3-)
NEWEST_PSP_DIR=$(find ./*PSP* -type d -prune | sort -V | tail -n 1 | cut -c 3-)
TARGET_SPRINT="${TARGET_SPRINT:-$NEWEST_PSP_DIR}"
echo "Executing SQL scripts in $TARGET_SPRINT"
#load db schema to local
Expand Down
2 changes: 1 addition & 1 deletion source/database/mssql/scripts/dbscripts/upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ fi

echo "Current db version installed: ${currentdbversion}";

NEWEST_PSP_DIR=$(find ./*PSP* -type d -prune | tail -n 1 | cut -c 3-)
NEWEST_PSP_DIR=$(find ./*PSP* -type d -prune | sort -V | tail -n 1 | cut -c 3-)
if [ -z "$TARGET_SPRINT" ];
then
echo "Targeting Latest";
Expand Down

0 comments on commit 60fb76e

Please sign in to comment.