So I have a basic problem trying to generate a migration when I don't have a DB in sync (up to the latest migration, in fact, have no DB at all) and have already made substantial changes to my model.
This are the specific details:
- Have a sequence of explicit migrations.
- Have no database. In short, have lots of pending changes.
- Made changes to the models/context.
- When trying to Add-Migration, it will complain saying precisely that explicit migrations are pending.
- If I try to execute the migration (and bring my DB in sync), either via Update-Database or migrate.exe, it will fail (after applying explicit migrations successfully), and automatic migrations are not enabled.
- I don't want to enable automatic migrations either (to prevent any schema changes to be committed and go unaccounted in code.)
I realize that after the failure in #5 I can now run #4. Then re-try #5 and voilá.
My Question is if this is the expected approach to solve this silly situation.
dbCtx.Database.Delete()to start the whole thing fresh from your models. - SimpleVar