EF Migrations for .NET Core 1.1.0 Without Visual Studio

EF Migrations for .NET Core 1.1.0 Without Visual Studio

Add the required dependencies in your project.json file

{
  "dependencies": { 
      ...
      "Microsoft.EntityFrameworkCore": "1.1.0",
      "Microsoft.EntityFrameworkCore.Design": {
          "version": "1.1.0",
          "type": "build"
      }
      ...
  },
  ...
  "tools": { 
      ...
      "Microsoft.EntityFrameworkCore.Tools.DotNet": "1.1.0-preview4-final"
      ...
  }
}

If you haven’t done so, import the libraries

  dotnet restore

Run the migration script

  dotnet ef migrations add NAME_OF_MIGRATION_CLASS
  dotnet ef database update