Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn on console when a generated migration contains reviewable steps #142

Open
joshprice opened this issue May 4, 2023 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@joshprice
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Destructive actions are commented out in generated migrations, but it's not clear to the user that something in the migration needs review.

Describe the solution you'd like

Ideally you should always review your migrations, but it'd be great to remind people of this with a note to this effect. Eg

Please always manually review the generated migrations for correctness

When there is something for review we should warn the user more emphatically to do so. Eg

Warning: there are migration steps commented out and in need of manual review

@joshprice joshprice added enhancement New feature or request needs review labels May 4, 2023
@MaxfieldLewin
Copy link

+1; just ran into this and was quite surprised. Coming from Django/Rails, they don't have such strong guardrails for destructive migrations, and it feels a bit overbearing for the generator to assume my changes were erroneous. Not that I don't appreciate the thought! I've seen plenty of migrations gone awry. IMO a sweet spot would be to have the warnings @joshprice suggests and then make it an opt-in configurable behavior to have destructive operations commented out or not.

@joshprice
Copy link
Contributor Author

I like that idea. Warnings + optional opt out does seem like a good compromise for new users and powerusers alike.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants