diff --git a/ct/sparkyfitness.sh b/ct/sparkyfitness.sh index 0daa9888b..b17d9e298 100644 --- a/ct/sparkyfitness.sh +++ b/ct/sparkyfitness.sh @@ -52,6 +52,19 @@ function update_script() { $STD pnpm install msg_ok "Updated Sparky Fitness Backend" + if [[ -f /opt/sparkyfitness/SparkyFitnessServer/auth.ts ]]; then + msg_info "Applying Better Auth Migrations" + cd /opt/sparkyfitness/SparkyFitnessServer + set -a + source /etc/sparkyfitness/.env + set +a + if $STD npx --yes @better-auth/cli migrate --config auth.ts -y; then + msg_ok "Applied Better Auth Migrations" + else + msg_warn "Better Auth migration failed - sign-in may report a schema mismatch until it is run by hand" + fi + fi + msg_info "Updating Sparky Fitness Frontend (Patience)" cd /opt/sparkyfitness $STD pnpm install