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

Add a prompt y/n #27079

Closed
nerd3717 opened this issue Dec 30, 2021 · 5 comments
Closed

Add a prompt y/n #27079

nerd3717 opened this issue Dec 30, 2021 · 5 comments
Labels
closed-out-of-scope This is not something that will be fixed/implemented and the issue is closed. customer-reported

Comments

@nerd3717
Copy link

Hello!
When creating a migration where a data type is converted from larger to smaller a warning is displayed:
An operation was scaffolded that may result in the loss of data. Please review the migration for accuracy

It would be nice to see here some prompt y/n, because some people may not pay attention to it.

@ErikEJ
Copy link
Contributor

ErikEJ commented Dec 30, 2021

And what would a reply of "n" result in?

@sigmade
Copy link

sigmade commented Dec 30, 2021

I agree that many people ignore the warnings. Entity Framework Core already faced the issue of warnings #14935

@sigmade
Copy link

sigmade commented Dec 30, 2021

And what would a reply of "n" result in?

Cancel Migration

@nerd3717
Copy link
Author

And what would a reply of "n" result in?

As I understand this happening after a migration have been created, I suppose the warning just result of comparing old and new state.
if there is any possibilities to predict this behaviour before 'creation', give a choice to user 'continue the process or not'

@ajcvickers
Copy link
Contributor

@nerd3717 Best practice for any generated migration is to review it to ensure that it's doing what you expect/want it to do. This is also the case for migrations that may cause data loss. The change might not actually cause data loss in any meaningful way to your application. Reviewing the migration is therefore the correct next step after this happens, after which it is easy to remove the migration if it isn't what was wanted.

@ajcvickers ajcvickers added closed-out-of-scope This is not something that will be fixed/implemented and the issue is closed. and removed type-enhancement labels Jan 11, 2022
@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-out-of-scope This is not something that will be fixed/implemented and the issue is closed. customer-reported
Projects
None yet
Development

No branches or pull requests

4 participants