Unanswered Use Entity Framework migration programtically

  • Friday, February 10, 2012 8:59 AM
     
     
    Is there no way of creating and executing migrations through my code?  We are in the very early stages of the project  and we have a lot of changes in the data base (code first).  I would like to create a mechanism that will automatically upgrade the DB (if required) whenever our application starts, without using Nuget.  is this possible?

All Replies

  • Friday, February 10, 2012 9:09 PM
     
     

    The MigrateDatabaseToLatestVersion database initializer can be used to execute migrations when the application starts.

    As far as creating migrations through your code, you can automatic migrations. For team envionments, we encourage the use of either all-automatic, or all-explicit migrations. When you start to mix automatic an explicit migrations in a team environment, merge conflicts that arise can become more difficult to resolve.


    Brice Lambson