I have a local database that is currently in it\'s second version and should now go to it\'s third version.
The code for the previous migrations was generated by ano
I had to Update-Database with the latest migration before the empty one appending this parameter -TargetMigration:"{your-migration-name}"
.
Probably it will tell you that there will be data loss from the next buggy one we tried. If you can afford it append -Force
to it.
Then I tried to add my new Add-Migration
and it wasn't empty.
Final thing that you may need to do if above is throwing exception is to go SQL Server Management Studio and delete the last Automatic migration
and try to add it again.