efcore icon indicating copy to clipboard operation
efcore copied to clipboard

A way to use custom migrations directory?

Open Yorie opened this issue 11 years ago • 5 comments

Seems command dnx ef migrations add doesn't support custom directories to save migrations to. So, having multiple database contexts will produce difficulties in generating migrations. Or am I wrong and it can be done some way?

Yorie avatar Sep 27 '15 07:09 Yorie

The tool will mimic the directory and namespace of the previous migration. Simply change them to what you want and code on.

bricelam avatar Sep 28 '15 15:09 bricelam

Yeah, this works awesome. Thanks for highlight this feature!

Yorie avatar Sep 28 '15 15:09 Yorie

I'm going to re-open this since we clearly have a discoverability issue here.

bricelam avatar Sep 28 '15 16:09 bricelam

Discussed and decided we should add a param to the command to allow you to specify directory ( we will imply namespace from this).

rowanmiller avatar Oct 02 '15 18:10 rowanmiller

In the meantime, you can just move the migrations since we will follow where the most recent migration is. The parameter would just override this behavior.

rowanmiller avatar Oct 02 '15 18:10 rowanmiller