Is it possible to change the location of the EF Migrations “Migrations” folder?

后端 未结 2 1352
说谎
说谎 2021-01-31 02:08

By default, the add-migration command attempts to create the migration .cs file in

  • Project Root
    • Migrations

I\'d like to store my

2条回答
  •  不要未来只要你来
    2021-01-31 02:31

    In the configuration class constructor add this line:

    this.MigrationsDirectory = "DirOne\\DirTwo";
    

    The namespace will continue to be set as the namespace of the configuration class itself. To change this add this line (also in the configuration constructor):

    this.MigrationsNamespace = "MyApp.DirOne.DirTwo";
    

提交回复
热议问题