Skip to content

SETUP_TYPE=MANUAL does not prevent database wipe (migrate:fresh) #234

@PatrickHuetter

Description

@PatrickHuetter

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions