Reputation: 137
Guys we moved Framework 7 to EF core 2.0 .So right now we have a Small problem.
when We use Entity Framework 7 its mostly easy to update client Database without any doubt.(update -database)
but in EF core there is a problem the reason is for every changes we have to add add-migration so in that case we have now 100 migration history.
example :(20180313063924_NewVersion,14689013063934_NewVersion etc)
so when we update client database we have to keep that 100 migration history But i think this is not the good way when its come to production level
is there anyway to resolve this problem.it would be helpful so much thank you!!
Upvotes: 0
Views: 353
Reputation: 3348
Well, it is exactly the way like EF and EFCore are working.
Every migration represents the needed modification on DbContext/Database to be valid with model's changes. So if you have changes, they will be represented by a migration.
One - in my opinion - not very clean solution could be:
Migrations
directory (is valid too to delete all migration files and <yourContextName>Snapshot.cs
file in Migrations
directory)InitialCreate
The result will be only one migration that represents your current project's model/dbcontext state. The approach is only possible if the project is still in dev-phase without any deployments on any stages.
Please note, I don't recommend that solution/approach. In my opinion you should leave the migrations like they are.
For further information you should read following:
Upvotes: 1