简体   繁体   English

使用Package Manager控制台添加迁移时定义迁移文件夹

[英]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.

相关问题 实体框架:在包管理器控制台VS 2012中添加迁移时抛出Null Reference Exception - Entity framework: Null Reference Exception thrown when adding migration in package manager console VS 2012 ReflectionTypeLoadException在程序包管理器控制台中运行add-migration命令时出错 - ReflectionTypeLoadException Error running add-migration command in package manager console 如何正确地从使用Package Manager控制台进行迁移期间创建的AspNetUsers表中删除列? - How to properly remove a column from AspNetUsers table that was created during a migration with Package Manager Console? 使用实体框架7添加新迁移时,表未添加到数据库 - Table not added to database when adding a new migration using entity framework 7 是否有执行与添加迁移相同的 function 的 EF Core Package 管理器控制台命令<name> EF6 中的 -IgnoreChanges 命令</name> - Is there an EF Core Package Manager Console command that performs the same function as the Add-Migration <name> -IgnoreChanges command in EF6 使用 NuGet 包管理器控制台时无法访问源 - Source unreachable when using the NuGet Package Manager Console 在 EF Core 中添加迁移 - Adding Migration in EF Core 向迁移添加扩展逻辑 - Adding extended logic to a migration 使用程序包管理器控制台卸载EntityFramework - Uninstall EntityFramework using the Package Manager Console EF Core 迁移在使用“ApplyConfiguration”时不起作用 - EF Core Migration not working when using `ApplyConfiguration`
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM