8

は、誰もが、次のコマンドの出力ディレクトリを変更する方法を知ってい:asp.netコア1.1での移行の出力フォルダを変更するにはどうすればよいですか?

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

私はオプションを追加してみました:

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

をそれは何もしません。ディレクトリには--data-dirオプションもありますが、それらのどれもが移行のための出力ではありません。

私の問題は、私は2つのDbContextsを持っているので、私はそれらのマイグレーションを分けたいのです。

答えて

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

Source

Usage: dotnet ef [options] [command] 

Options: 
    -h|--help       Show help information 
    -p|--project <PROJECT>    The project to target (defaults to the project in the current directory). Can be a path to a project.json or a project directory. 
    -s|--startup-project <PROJECT>  The path to the project containing Startup (defaults to the target project). Can be a path to a project.json or a project directory. 
    -c|--configuration <CONFIGURATION> Configuration under which to load (defaults to Debug) 
    -f|--framework <FRAMEWORK>   Target framework to load from the startup project (defaults to the framework most compatible with .NETCoreApp,Version=v1.0). 
    -b|--build-base-path <OUTPUT_DIR> Directory in which to find temporary outputs. 
    -o|--output <OUTPUT_DIR>   Directory in which to find outputs 

Commands: 
    database Commands to manage your database 
    dbcontext Commands to manage your DbContext types 
    migrations Commands to manage your migrations 
+1

あなたがC#でフォルダを設定する方法を知っていますか?私は毎回余分な議論を使用したくないです。 –

+0

これは** C#のものではありません。 .NET Core SDKに付属の.NET Coreコマンドラインを使用して、.NET Coreアプリケーション(さらにはEntity Frameworkコア)にコマンドを送信しています。 .NET Coreで動作しなかったのは数カ月でしたので、私はあなたの質問に答えられません。私はこれまでに可能だったとは思っていません。新しい.NETコア機能に従わなかったのです... –

+0

そうでなければ、たびたびあなたが入力するように怠けているなら、あなたのコマンドを含む 'cmd'ファイルを作成することができます。 –

関連する問題