Skip to content

Display migrations to be rolled back before confirmation #58861

@mdrakash

Description

@mdrakash

Laravel Version

^12.0

PHP Version

^8.3

Database Driver & Version

MySql 8

Description

When running migrate:rollback in production, Laravel may roll back
previous successful migrations if the latest migration failed
silently (for example, during CI/CD).

This can lead to unintended data loss.

Proposal:
Before executing rollback, display the list of migrations that will
be rolled back and ask for explicit confirmation. This confirmation
should be skipped when --force is used.

This change improves safety while remaining backward compatible.

Steps To Reproduce

Proposal:
Before executing rollback, display the list of migrations that will
be rolled back and ask for explicit confirmation. This confirmation
should be skipped when --force is used.

This change improves safety while remaining backward compatible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions