Base solution for your next web application
Open Closed

AngularJs 1.x upgrade to 4.1.0 migration issue #3504


User avatar
0
dmali created

Hi,

today I've tried to upgrade our AngularJs 1.x 4.0.0 solution to 4.1.0, but for some reason after applying "201706200346086_Update_ABP_Migrations" migration, EF thinks that the data model has pending changes.

Steps which I did:

  1. mergin source files
  2. updating nuget packages
  3. updating database

what I noticed is that after updating database structure (201706200346086_Update_ABP_Migrations) I get warning message in PMC saying:

Unable to update database to match the current model because there are pending changes and automatic migration is disabled. Either write the pending model changes to a code-based migration or enable automatic migration. Set DbMigrationsConfiguration.AutomaticMigrationsEnabled to true to enable automatic migration. You can use the Add-Migration command to write the pending model changes to a code-based migration.

In the database I see that the migration was executed(new line in MigrationHistory table).

If I call "Add-Migration" in PMC I will get a migration file with all changes which I did since 4.0.0.

Has anybody an idea what is going on?

Best regards


3 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Have you copied migration file "201706200346086_Update_ABP_Migrations" from 4.1 to your project ? If so, you should create migration files by running "Add-Migration" command.

    If you can revert the last migration (Deleting last row in Migration history might do this), delete the migration file "201706200346086_Update_ABP_Migrations" from your solution and then run Add-Migration command. It should create the same migration with this one <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero/blob/dev/src/MyCompanyName.AbpZeroTemplate.EntityFramework/Migrations/201706200346086_Update_ABP_Migrations.cs">https://github.com/aspnetzero/aspnet-ze ... rations.cs</a>.

    Then you can update your database.

    Thanks.

  • User Avatar
    0
    dmali created

    Hi,

    you are the best!!!

    Thank you for your support.

    kind regards

  • User Avatar
    0
    ismcagdas created
    Support Team

    You are welcome @dmali :)