0

I wanted to enable migrations for my database, then it gave me the following errors:

More than one context type was found in the assembly 'The Factory Chante'.
To enable migrations for 'The_Factory_Chante.Models.ApplicationDbContext', use Enable-Migrations -ContextTypeName The_Factory_Chante.Models.ApplicationDbContext.
To enable migrations for 'The_Factory_Chante.Models.The_FactoryDBContext', use Enable-Migrations -ContextTypeName The_Factory_Chante.Models.The_FactoryDBContext.

I then quickly realised that I have two databases in my solution and I would like merge the The_Factory_Chante.Models.ApplicaticayionDBContext auto implemented database by MVC with my already existing database.

ekad
  • 14,056
  • 26
  • 43
  • 45

1 Answers1

0

go to tools package manager console in Visual studio enter Enable-Migration then enter Update Database -Verbose

if it fails

You will then need to specify which configuration you want to use when updating the databases.

Update-Database -ConfigurationTypeName MyRenamedConfiguration
Midhun Mundayadan
  • 3,106
  • 3
  • 18
  • 32