Error on updating database / erasing last migration RRS feed

  • Question

  • User2074931137 posted

    If I have a problem updating database after a migration and get an error (below) trying to create a new migration to reverse the changes that prevented the database update...

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

    ...and want to eliminate the last migration, can I simply delete the last migration folder in the the migration folder under Solution Explorer?

    Or, in other words, how do I eliminate the last migration?

    Tuesday, January 29, 2019 12:04 PM


  • User1520731567 posted

    Hi 3v3rhart,

    According to your descriptions,

    I suggest you could try to right click [201901281242341_ScheduleCalendarDate1],and click 'Exclude From Project' ...

    or you could try to comment the code you think is problematic according to your error messagae in Up() and Down() function in migration file.

    Best Regards.

    Yuki Tao

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, January 30, 2019 6:12 AM