سؤال

I am using EF 6.1 and I use code first approach with an existing database with data in a production environment.

Is it possible at all to migrate model changes and keep the existing customer`s data?

هل كانت مفيدة؟

المحلول

Yes, however, it can be complicated depending on specific case (on complexity of changes):

Overview: https://learn.microsoft.com/en-us/ef/ef6/modeling/code-first/migrations/existing-database

Read this: https://learn.microsoft.com/en-us/ef/ef6/modeling/code-first/migrations/index

And then this: https://learn.microsoft.com/en-us/ef/ef6/modeling/code-first/migrations/teams

Update: updated the links based on redirects.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top