0

Migration data first time success. But when I update entity and migration again, it fails:

Unable to generate an explicit migration because the following explicit migrations are pending: [201712281248174_ttt]. Apply the pending explicit migrations before attempting to generate a new explicit migration.

Help! Thank you!

nickgryg
  • 25,567
  • 5
  • 77
  • 79
T.y
  • 1
  • Try [these suggestions](https://stackoverflow.com/questions/9817860/unable-to-generate-an-explicit-migration-in-entity-framework) first and report back if your scenario is different along with relevant code and things you have tried. – Steve Greene Dec 28 '17 at 14:27

1 Answers1

0

You have to enable automatic migrations in your migration configuration file.

public Configuration()
{
    AutomaticMigrationsEnabled = true;
}

or explicitly run command Update-Database in Package Manager Console.

dropoutcoder
  • 2,627
  • 2
  • 14
  • 32
  • Thank you! I find the problem is the HasDefaultSchema parameter difference with the User Id in connectionStrings. – T.y Dec 29 '17 at 05:36