1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-25 12:45:18 +01:00
bitwarden-server/util/Migrator/createVaultDev.sh
Thomas Rittson fd42b227b3
Update dev setup guide (#1222)
* Update dev setup guide with current best practice

* Minor amendments to setup instructions

* Move vault_dev migrator script to its own file

* Fix typo, use command line args for SA_PASSWORD

* Move setup guide to its own file

* fix typo
2021-03-22 07:56:31 +10:00

22 lines
709 B
Bash

# Creates and populates vault_dev - used for development purposes
# This should be run from within an empty MSSQL Docker container
# See instructions in SETUP.md
if [ -z $1 ]; then
echo "Error: you must provide SA_PASSWORD as the first argument."
echo "You should wrap your password in single quotes to make sure it is correctly interpreted."
exit 1
fi
MIGRATE_DIRECTORY="/mnt/migrator/DbScripts/"
SERVER="localhost"
DATABASE="vault_dev"
USER="sa"
PASSWD="$1"
/opt/mssql-tools/bin/sqlcmd -S $SERVER -d master -U $USER -P $PASSWD -I -Q "CREATE DATABASE $DATABASE;"
for f in `ls -v $MIGRATE_DIRECTORY/*.sql`; do
/opt/mssql-tools/bin/sqlcmd -S $SERVER -d $DATABASE -U $USER -P $PASSWD -I -i $f
done;