Add-Migration creating an empty migration in migration codes / code first

First I use code transitions in code. I changed one of my models (domain class) and the changes were raised when I added the migration. So far, so good. Now this is the part where I can do something wrong:

  • I made additional changes, making the previous modification inconsequential.
  • I removed the migration and tried to make a decision, I got an empty migration. Now I understand that the database tracks the migration history. So I understand why it was stupid.
  • My next step was to delete the rows in the database - it also sounds like it's not a good idea. The appropriate way to โ€œbacktrackโ€ is to do an Update-Database -Target: {MigrationName}
  • An attempt by both of them I still get an empty migration. I also tried resetting the database and updating it before migration.

My google / SO foo failed me. I think what happens is that VS / Entity does not detect changes in my model, and I'm not sure what a trigger is. Can someone help me?

+5
source share
1 answer

I had a similar problem. My solution was to simply move forward when there was an inconclusive movement of matter. The only change he makes is to add an entry to the __Migration table, but I live with this and just go ahead.

+1
source

Source: https://habr.com/ru/post/1204137/


All Articles