Base solution for your next web application
Open Closed

Problems with ngMYAPPDbContextModelSnapshot.cs file after upgrading to higher version #8916


User avatar
0
peteras created

Hi, I have upgraded version 5.6 to 8.6 and I have isse whe creating new migration file the platform recreates all of my existing table once more in new migration file but note that nothing changed except upgrade was done and I was testing if something was left for migration ....

Is there any way or work around that I can do to "convinced" platform that tables are already created and "add-migration" is not including them?

thank you in advanced. reP


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

    Hi @peteras,

    Did you also upgraded your Snapshot file with AspNet Zero's latest version ? If so, reverting it back and creating a new migration might solve your problem.

  • User Avatar
    0
    peteras created

    Hi ismcagdas thank you for quick reply. Would you be so kind and please provide more info how to do this?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    If you commit your changes to source control you can just revert change of merge from AspNet Zero latest version for your Snapshot file. This file shouldn't be modified manually. Then, you can just run "Add-Migration" command to create a new migration.

  • User Avatar
    0
    peteras created

    Hi,

    I have already tried this - but "Add-Migration" creates all tables once more :(. when I was resolving conflicts I have rewrite my old snapshot file with new one. When I did test migration I saw the problem so I restore old snapshot file and problem is still present.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Is it possible to share your project with [email protected] ?

    Thanks,

  • User Avatar
    0
    peteras created

    Hi,

    I was able to resolve issue. I did start once again with upgrade procedure and committing every step of the way. I was able to resolve isse to create migrattion before updating database with new version's DB changes. Now all is OK.

    Thank you for your help.