-
-
Notifications
You must be signed in to change notification settings - Fork 122
Description
Description
When SETUP_TYPE=MANUAL is set, the container still runs php artisan migrate:fresh
if the database connection check fails, completely wiping all existing data. This is
critical for restore scenarios where data has been recovered from backup.
Expected Behavior
When SETUP_TYPE=MANUAL is set, the container should never run
php artisan migrate:fresh automatically.
Actual Behavior
The SETUP_TYPE variable only affects .env configuration. The database check at the
end of the init script ignores SETUP_TYPE - if psql/mysql returns exit code > 0,
it runs migrate:fresh unconditionally.
Suggested Fix
Wrap the database check with a SETUP_TYPE condition:
if [ "${SETUP_TYPE,,}" = "manual" ]; then
print_info "SETUP_TYPE=MANUAL - Skipping database initialization check"
else
# ... existing DB check and migrate:fresh logic ...
fi
Related Issues
- Installation script doesn't correctly detect current installation when SSL certificate error. Deletes database #210 - SSL connection issues causing false "empty database" detection