Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

define migration folder when adding migration using Package Manager Console

Before I was using Windows command line to add migrations and it was working properly.

dotnet ef migrations add MigrationName -o Data\Migrations

I tried using Package Manager Console like:

add-migration "MigrationName"

This adds the migration successfully but to the project main folder not to the Data folder.

How can I tell it to add the migration to the Data folder?

like image 511
Ashkan Mobayen Khiabani Avatar asked Aug 31 '25 06:08

Ashkan Mobayen Khiabani


1 Answers

You need to specify path in outputDir option

add-migration InitialIdentityModel-v1 -OutputDir ".\Data\Migrations\"

like image 117
panky sharma Avatar answered Sep 02 '25 20:09

panky sharma