EntityFramework.DatabaseMigrator is a WinForms utility to help manage Entity Framework 6.0+ migrations.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
EntityFramework.DatabaseMigrator.Example
EntityFramework.DatabaseMigrator
.gitattributes
.gitignore
EntityFramework.DatabaseMigrator.sln
License.txt
PublishPackage.bat
Readme.md

Readme.md

EntityFramework.DatabaseMigrator

NuGet Packages

Install-Package EntityFramework.DatabaseMigrator

Back story and additional details available here.

Instructions

Assuming you already have migrations enabled,

  1. Add a new WinForms project to your solution.

  2. Delete the form automatically added to the new project.

  3. Open program.cs in the root of your project and change Form1 to EntityFramework.DatabaseMigrator.DatabaseMigrator

        static class Program
        {
            /// <summary>
            /// The main entry point for the application.
            /// </summary>
            static void Main()
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new EntityFramework.DatabaseMigrator.DatabaseMigrator());
            }
        }
  4. Change your migration configuration to inherit from BaseMigrationConfiguration or add and implement the IMigrationConfiguration interface.

    internal sealed class Configuration : BaseMigrationConfiguration<EntityFramework.DatabaseMigrator.Example.Data.BlogContext>
    {
        public Configuration()
        {
            AutomaticMigrationsEnabled = false;
            ContextKey = "EntityFramework.DatabaseMigrator.Example.Data.BlogContext";
        }
    }