[Fix]: Wizarr DB error during install (#9415)

* test skip scheduler during install & not running migration

- migration is run by the start script anyway, I think

* restore db upgrade during install/update; add new env vars; patch start.sh
This commit is contained in:
Chris
2025-11-24 16:03:19 -05:00
committed by GitHub
parent cf89b17b0d
commit e54f372079
2 changed files with 24 additions and 6 deletions

View File

@ -52,11 +52,21 @@ function update_script() {
$STD npm --prefix app/static run build:css
mkdir -p ./.cache
$STD tar -xf "$BACKUP_FILE" --directory=/
$STD /usr/local/bin/uv run --frozen flask db upgrade
if ! grep -q 'frozen' /opt/wizarr/start.sh; then
sed -i 's/run/& --frozen/' /opt/wizarr/start.sh
if grep -q 'workers' /opt/wizarr/start.sh; then
sed -i 's/--workers 4//' /opt/wizarr/start.sh
fi
if ! grep -qE 'FLASK|WORKERS|VERSION' /opt/wizarr/.env; then
{
echo "FLASK_ENV=production"
echo "GUNICORN_WORKERS=4"
echo "APP_VERSION=$(sed 's/^20/v&/' ~/.wizarr)"
} >>/opt/wizarr/.env
else
sed -i "s/_VERSION=v.*$/_VERSION=v$(cat ~/.wizarr)/" /opt/wizarr/.env
fi
rm -rf "$BACKUP_FILE"
export FLASK_SKIP_SCHEDULER=true
$STD /usr/local/bin/uv run --frozen flask db upgrade
msg_ok "Updated Wizarr"
msg_info "Starting Service"