Files
beekeeper-studio/dev/docker_sqlserver/data.sh
2020-03-12 21:03:23 -05:00

18 lines
360 B
Bash
Executable File

#! /bin/bash
set -euxo pipefail
FILE=/var/opt/mssql/.initialized
if test -f "$FILE"; then
echo "database already initialized"
else
sleep 30s
/opt/mssql-tools/bin/sqlcmd -S localhost -i /docker_init/1_schema.sql -U sa -P "$SA_PASSWORD"
/opt/mssql-tools/bin/sqlcmd -S localhost -i /docker_init/2_data.sql -U sa -P "$SA_PASSWORD"
touch "$FILE"
fi