Search for existing suggestions

Creating & Updating DB (syncing) with the code-first model

Just like NHibernate had special DB tools to update schema (database) [or just to create SQL for manual update] according mapping, same functionality would be nice to have with EF7, so that all those simple updates could be done from code.

I've tried migrations too, but:
- forced me to create dbcontext with basic ctor
- forced me to include default connection string
- after deleting one table from database, udpdating the database did nothing (since according other data the given migration was applied).

So the function above i'm suggesting is not something that has to do with migration, but more with DB changes while developing...

4 votes
Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)

We’ll send you updates on this idea

Anonymous shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

We already have EnsureCreated() and EnsureDeleted() for very simple development/testing scenarios, and Migrations for all the other scenarios.

I understand you are convinced that you need something else, but we are not planning to add an entirely new way of keeping the database in sync outside of these options.

I believe we can try to make Migrations easier to use for more scenarios though.

I am not convinced that I understand the scenarios you described, but a couple of things you mention are supposedly already supported, e.g. Migrations works with different constructors and having the connection string specified externally. So it could be that you are hitting a bug or usability issues.

In any case, it would be great if you could elaborate more on specific issues at http://github.com/aspnet/entityframework.

0 comments

Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
Submitting...

Feedback and Knowledge Base