Skip to content

Commit

Permalink
Merge pull request #2 from jgkawell/db-with-volume
Browse files Browse the repository at this point in the history
DB migrations from volume
  • Loading branch information
TheNoim authored Dec 7, 2021
2 parents 0d910e3 + b1e700e commit 9b0ba22
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ services:
- MARIADB_DATABASE=${MARIADB_DATABASE:-darkflame}
volumes:
- database:/var/lib/mysql
- migrations/dlu:/docker-entrypoint-initdb.d
networks:
- darkflame

Expand Down
13 changes: 0 additions & 13 deletions docker/start_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,6 @@ function fdb_to_sqlite() {
)
}

function run_db_migrations() {
(
cd /app/migrations/dlu
readarray -d '' entries < <(printf '%s\0' *.sql | sort -zV)
for entry in "${entries[@]}"; do
echo "Execute $entry"
mysql -h"$DATABASE_HOST" -P"$DATABASE_PORT" -u"$DATABASE_USER" -p"$DATABASE_PASSWORD" $DATABASE < $entry
done
)
}

set_defaults

check_sql_connection
Expand Down Expand Up @@ -118,8 +107,6 @@ symlink_client_files

fdb_to_sqlite

run_db_migrations

echo "Start MasterServer"

./MasterServer
Expand Down

0 comments on commit 9b0ba22

Please sign in to comment.