Asp.net core asp net核心创建自己生成的迁移,如rails
是否有在asp net项目中手动创建迁移的方法?生成空迁移文件并添加将更改数据库结构的代码 在asp net核心中:Asp.net core asp net核心创建自己生成的迁移,如rails,asp.net-core,Asp.net Core,是否有在asp net项目中手动创建迁移的方法?生成空迁移文件并添加将更改数据库结构的代码 在asp net核心中: 改变模式 class Product { public string PartNumber { get; set; } } dotnet ef migrations add MyMigration->它将检查模型并自动生成迁移 在RubyonRails中 rails生成迁移MyMigration 编写迁移 class AddPartNumberToProducts &
class Product
{
public string PartNumber { get; set; }
}
class AddPartNumberToProducts < ActiveRecord::Migration[5.0]
def up
add_column :products, :part_number, :string
end
end
class AddPartNumberToProducts
我更喜欢Rails方式…您仍然可以修改ef migrations add命令生成的迁移。或者你的问题是什么?我想使用迁移,但我想自己编写所有迁移,而不需要EF自动检查模型类。