Code of Conduct
Feature Description
Introduce a dedicated, read-only migrationplan command to prevent accidental database execution, providing a safe alternative to the high-risk migrate --plan flag.
Problem
When migrating changes, we often find ourselves executing these two commands directly on the server or locally.
python manage.py migrate --plan #show me what's planned
If the output is clean and expected, we commit the changes using
python manage.py migrate #yep execute this plan
First command is ready-only which displays what's django will commit to database if we went ahead with migrate command whereas migrate is a destructive command that will make changes to your schema if ran successfully.
For destructive commands it's generally a better UX to be more explicit, so when you're running the --plan (you're almost close to writing migrate version since it's a superset of that command). If accidentally ran, it can be painful/frustrating experience.
Request or proposal
proposal
Additional Details
--plan can be later deprecated if required
Note: Also this pattern can be called out for other flags on migrate command, that's something worth discussing.
Implementation Suggestions
Open to suggestions but this can be a good candidate
python manage.py migrationplan
can be used to do what
python manage.py migrate --plan
separating both migrate and migrate --plan
Code of Conduct
Feature Description
Introduce a dedicated, read-only migrationplan command to prevent accidental database execution, providing a safe alternative to the high-risk migrate --plan flag.
Problem
When migrating changes, we often find ourselves executing these two commands directly on the server or locally.
If the output is clean and expected, we commit the changes using
First command is ready-only which displays what's django will commit to database if we went ahead with migrate command whereas migrate is a destructive command that will make changes to your schema if ran successfully.
For destructive commands it's generally a better UX to be more explicit, so when you're running the --plan (you're almost close to writing migrate version since it's a superset of that command). If accidentally ran, it can be painful/frustrating experience.
Request or proposal
proposal
Additional Details
--plan can be later deprecated if required
Note: Also this pattern can be called out for other flags on migrate command, that's something worth discussing.
Implementation Suggestions
Open to suggestions but this can be a good candidate
python manage.py migrationplancan be used to do what
python manage.py migrate --planseparating both migrate and migrate --plan