By using "Code First" model programming is possible to create migrations do update database schema. Is possible to create migrations to update database schema using ASP.Net Entity Framework and "DB First"? Is possible to somehow update database schema (without data loss)?
-
I don't really know how this would work. DB first means: EF creates POCO classes from database schema. Code first means: EF maps Db schema according to given POCO classes. So the migration would basically create POCO classes and migrate this to another schema you somewhere saved? How would the new context be accessed? I don't really know how this would work. To your update question: You can use null initializer and update your schema with SQL queries, however I'm not sure if you can use EF the same way you used to after this.DevilSuichiro– DevilSuichiro2016-06-28 20:16:45 +00:00Commented Jun 28, 2016 at 20:16
Add a comment
|
1 Answer
You can do "Code First from an existing database" if that's what you mean. Here's a walkthrough.
This will create models for you in C# based on the existing database design, it's basically a one-time setup. From there you can use it as if you were Code First all along.