[英]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. 在使用Windows命令行添加迁移之前,它已经正常工作。
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? 如何告诉它将迁移添加到“数据”文件夹?
You need to specify path in outputDir option 您需要在outputDir选项中指定路径
add-migration InitialIdentityModel-v1 -OutputDir ".\\Data\\Migrations\\"
add-migration InitialIdentityModel-v1 -OutputDir“。\\ Data \\ Migrations \\”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.