How to change the output folder for migrations with asp.net Core?

asp.net asp.net-core command-line-interface database entity-framework

Question

Does anybody know how to modify the following command's output directory?

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

I tried including the choice:

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

But it makes no difference. Exists a--data-dir Option and another with directory are both available. However, none of them serve as migration output.

My issue is that I have two DbContexts, thus I need to split the migrations for each.

1
48
2/27/2020 9:00:40 AM

Accepted Answer

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".

66
1/15/2020 7:52:20 AM

Popular Answer

ZZZ_tmp


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow