Skip to content

Commit

Permalink
fix: initialize database
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean Honlet committed Feb 26, 2025
1 parent 4afecc4 commit 9b3d0f2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions services/database/initial/500 versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
set -o pipefail
set -o errexit

version="$(docker_process_sql cryptomedic --raw --silent -e 'SELECT value FROM settings WHERE id = "structure_version"')"
run_mysql() {
mysql -uroot cryptomedic "$@"
}

version="$(run_mysql --raw --silent -e 'SELECT value FROM settings WHERE id = "structure_version"')"
echo "Initial version: $version"

readarray -d '' files < <(printf '%s\0' /versions/* | sort -zV)
Expand All @@ -15,7 +19,7 @@ for f in "${files[@]}"; do
echo "Skipping $fn [$vf]"
else
echo "Running $fn [$vf]"
docker_process_sql <"$f"
run_mysql <"$f"
version="$vf"
fi
else
Expand Down

0 comments on commit 9b3d0f2

Please sign in to comment.