Skip to content

Commit

Permalink
feat: Add ability to load sample data from hidden sql directory in lo…
Browse files Browse the repository at this point in the history
…cal env (#1654)
  • Loading branch information
john-fletcher-aot authored Oct 25, 2024
1 parent f8b808e commit f54b0cc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion database/mssql/scripts/sampledata/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Ensure the unencrypted TPS test data is kept out of git
tps.*
tps.*
_private_sql/
10 changes: 10 additions & 0 deletions database/mssql/scripts/utility/refresh-sample-data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,14 @@ sqlcmd -C -U ${ORBC_USER} -P "${ORBC_PASS}" -S ${ORBC_SERVER} -d ${ORBC_DATABASE
echo "Setting credit account sequence restart to current timestamp (used only for lower environments)"
sqlcmd -C -U ${ORBC_USER} -P "${ORBC_PASS}" -S ${ORBC_SERVER} -d ${ORBC_DATABASE} -i ${SCRIPT_DIR}/sampledata/permit.ORBC_CREDIT_ACCOUNT_NUMBER_SEQ.sql

if [ -d "${SCRIPT_DIR}/sampledata/_private_sql" ]
then
echo "Running private SQL (non-repository)"
for f in ${SCRIPT_DIR}/sampledata/_private_sql/*.sql;
do
echo "Processing $f file...";
sqlcmd -C -U ${ORBC_USER} -P "${ORBC_PASS}" -S ${ORBC_SERVER} -d ${ORBC_DATABASE} -i $f
done
fi

echo "Finished loading sample data"

0 comments on commit f54b0cc

Please sign in to comment.