How to change the output folder for migrations wit

2019-03-17 09:43发布

Does anyone know how to change the output directory of the following command:

dotnet ef  migrations add Initial --context EsportshubApi.Models.ApplicationDbContext

??

i tried to add the option:

--content-root-path 'Migrations/Identity' 

but that doesn't do anything. There is a --data-dir option aswell and something else with directory, but none of them is the output for migrations.

My problem is that i have 2 DbContexts so i want their migrations separated.

1条回答
狗以群分
2楼-- · 2019-03-17 10:30
dotnet ef  migrations add Initial --context EsportshubApi.Models.ApplicationDbContext -o YourFolderPath

Source

dotnet ef migrations add

Adds a new migration.

Arguments:

< NAME >        The name of the migration.

Options:

-o        --output-dir < PATH >        The directory (and sub-namespace) to use. Paths are relative to the project directory. Defaults to "Migrations".

查看更多
登录 后发表回答