I持って、次のscenario-私は3つの新しいマイグレーションを追加した支店で働いていますマージ複数回の移行Entity Frameworkのコードファースト
- しようとしたとき、私は彼ら
Migration A
Migration B
Migration C
に名前を付けるだろう大会のためにmaster
とマージすると、時間順に並べられていない4つの新しいマイグレーションがあることが分かります(別のブランチからマージされています)。追加するとき - 私は何を意味することは、次の
new Migration from master 1
existing Migration in both branches
existing Migration in both branches
new Migration from master 2
new Migration from master 3
new Migration from master 4
existing Migration in both branches
existing Migration in both branches
そして、私が今明らかにEntity Frameworkのは、それはモデルが間違っていると考えているので、私はデータベースを更新させません、次のシナリオ
new Migration from master 1
existing Migration in both branches
existing Migration in both branches
new Migration from master 2
new Migration from master 3
new Migration from master 4
existing Migration in both branches
existing Migration in both branches
Migration A
Migration B
Migration C
を得る合流です新しい移行では、前述の4つの新しい移行からの変更がmaster
から生成されます。
本当の問題は、(別のquestionでanswerを受け入れごとに示唆されているように)彼らは時系列 を発注していないので、私は、メタデータを更新するために、既存のバック移行してから再足場に戻すことはできませんということです。
私はそれを再骨格にnew Migration from master 1
、その後Add-Migration <timestamp> new Migration from master 1
前に戻って、移行にupdate-database -target
に試してみましたが、私はUnable to generate an explicit migration because the following explicit migrations are pending....
例外を取得。
これを修正するためにブランクマイグレーションを追加するのではなく、これをクリーンで適切な方法で見つけてください。