migrations

Run migrations

Run EntityFramework migrations to create database schema for blog module.

To run migrations from command line, we first create an empty folder, copy all files from "packagesEntityFramework.6.1.3 ools" to this new folder. Also, copy all files from "MyAbpZeroProject.Webin" (project should be built in Debug once) to this new folder (EF version or project name may be different for your case). Then we can use migrate.exe to update database:

migrate.exe Abp.Samples.Blog.EntityFramework.dll /connectionString="Server=localhost;Database=YOUR_DATABASE;User=sa;Password=YOUR_PASSWORD;" /connectionProviderName="System.Data.SqlClient"

Note that, from now we have 2 different migrations: One for our application and one for blog module. We first run our own migrations since blog module requires AspNet Zero tables exist in the database.

原文地址:https://www.cnblogs.com/zymsdn/p/5547849.html