Fix migration issues

This commit is contained in:
2025-08-25 14:28:30 +09:00
parent 961c577ec8
commit 6886ba15c8
7 changed files with 403 additions and 28 deletions

21
start-app.sh Normal file
View File

@ -0,0 +1,21 @@
#!/bin/bash
set -e
echo "Waiting for PostgreSQL..."
./wait-for-postgres.sh postgres-db
echo "Checking migration status..."
python manage.py showmigrations
echo "Attempting migration with error handling..."
if python manage.py migrate --check; then
echo "No migrations needed"
elif python manage.py migrate --fake-initial; then
echo "Migrations applied successfully"
else
echo "Migration failed, trying fake-initial..."
python manage.py migrate --fake-initial || echo "Fake-initial also failed, proceeding anyway..."
fi
echo "Starting Gunicorn..."
exec gunicorn config.wsgi:application --bind 0.0.0.0:8000