EF7 Migrations DNX Commands

Installing

Install-Package EntityFramework.Commands -Version 7.0.0-beta5 -Pre 

{
    "dependencies": {
        "EntityFramework.Commands": "7.0.0-beta5"
    },
    "commands": {
        "ef": "EntityFramework.Commands"
    }
}

Once you have done this, you should be able to restore packages, change directory into your project (the directory containing the project.json file), and run the command.

dnu restore
cd src\apnetTestApp
dnx . ef

ef

Using
To see all the sub-commands are available for the migration command, type dnx . ef migration --help. For now, there are five commands

  • add–Add a new migration
  • apply–Apply migrations to the database
  • list–List the migrations
  • script–Generate a SQL script from migrations
  • remove–Remove the last migration

To see the usage of the add command, type dnx . ef migration add --help.
To add a new migration, type dnx . ef migration add “migration name”.

Summary
In this way we will be able to add, apply migration in entity framework 7, after changing the name of commands.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s