Entity Framework Feature Suggestions

Schema Migration a la Rails Migrations

Database change management is a huge headache without the right tools, and the Microsoft stack doesn't have a good answer for this right now.

Database projects were a valiant attempt, but diff-ing a live database with a set of text files is a clunky approach.

Migrations have been used successfully on other platforms (notably, Ruby on Rails) to achieve iterative database change management. Several open-source projects on the .NET platform have even been started, but none have really gained traction.

A migration solution from Microsoft with good tool integration would go along way to making database change management on the Microsoft platform easier.

417 votes
Vote 0 votes Vote Vote
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service

    You'll receive a confirmation email with a link to create a password (optional).

    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Brian SullivanBrian Sullivan shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    9 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service

      You'll receive a confirmation email with a link to create a password (optional).

      Signed in as (Sign out)
      Submitting...
      • Diego VegaAdminDiego Vega (Admin, DataFx) commented  ·   ·  Flag as inappropriate

        Hello Moby,

        Some of the same ideas might apply but I think the mechanics would need to be different. Could you please try to flesh out what you have in mind in a separate idea? That way others can vote for it and add comments, and we can track it more accurately.

      • Moby DiskMoby Disk commented  ·   ·  Flag as inappropriate

        Everyone is talking code-first when the same ideas should apply to model-first as well. Does anyone use model-first or is that a dead-end now?

      • HiredMindHiredMind commented  ·   ·  Flag as inappropriate

        Just FYI - I'm using Migrator.NET - works great, although I did need to add some convenience extensions to customize it for my tastes. (I'm not associated with the project, just a happy user)

      • DorianDorian commented  ·   ·  Flag as inappropriate

        Migrations are crutial for us. Currently we use Mig#. It's open source. Right now we use Codefirst, and in the DBinitializer we check if the schema is up to date and if it's not then we call MigSharp.Migrator.Update. It would be good if this kind of thing could be combined into EF - out of the box!

      • Sean KellySean Kelly commented  ·   ·  Flag as inappropriate

        Auto-Magic Migration (CodeFirst or not) is a WONDERFUL way to sync development changes with a production database. Especially for light-weight development teams/projects.

        We are adding a property/field. Do it.

        We are adding a related class/table. Do it.

        Having the more sophisticated custom "scripts" that include data manipulation (with order of operations) is wonderful too--please don't throw out the Auto-Magic Baby with the Technical Bath Water.

      • Moby DiskMoby Disk commented  ·   ·  Flag as inappropriate

        If you are using model-first, you can download the "Entity Designer Database Generation Power Pack" and use a "Sync Database project"

      • danvanderboomdanvanderboom commented  ·   ·  Flag as inappropriate

        Schema versioning is one of the most difficult challenges of maintaining a mature application. Good tool support would go a long way to reducing the risk involved in making schema changes.

      • DaveDave commented  ·   ·  Flag as inappropriate

        Agreed. Especially with code-first development autogenerating schemas, to then go and and manually create SQL to migrate from one autogenerated schema to another for application upgrades is a monster pain.

      Knowledge Base and Helpdesk