1

I currently have one project which has one database with code migrations enabled.

Meanwhile I need to create another database inside the same project, and I am not sure how to enable-migrations to this context.

Or this is not the correct approach? And I should create a new project specifically to this new database?

Thanks

David Martin
  • 11,764
  • 1
  • 61
  • 74
user2779312
  • 661
  • 2
  • 9
  • 23
  • I think that for the members of SO to be able to provide a good answer, you need to provide much more information. – Nathan White Oct 20 '14 at 11:05
  • If all you want is to create 2 Entity Framework databases inside one project that is possible to do all you have to do is redo the create database code with a different path. – ZoomVirus Oct 20 '14 at 11:18
  • 1
    Given I understood your question right, have a look at this post: http://stackoverflow.com/a/21538091/3129340. It handles migrations of multiple contexts inside the same project. – Thaoden Oct 20 '14 at 12:13

1 Answers1

0

using this command in visual studio package manager console: Add-Migration yourMigrationClassName -Context yourContextName and then: update-migration -Context yourContextName

where yourContextName is DbContext class name in your Project and yourMigrationClassName is migration class name you want to create

Amin Sahranavard
  • 268
  • 1
  • 10
  • You should give more information about your solution. Explain it more clearly so people can understand it. – Akah Jan 30 '17 at 08:14