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

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

dotnet ef migrations add

Adds a new migration.

Arguments:

ArgumentDescription
<NAME>The name of the migration.

Options:

OptionShortDescription
--output-dir <PATH>-oThe directory used to output the files. Paths are relative to the target project directory. Defaults to “Migrations”.
--namespace <NAMESPACE>-nThe namespace to use for the generated classes. Defaults to generated from the output directory. Added in EF Core 5.0.

Also here are the common options you can use with this command.

Source

Leave a Comment