Open Closed

DbMigrator doesn't add changes when moving to another environment #5627


User avatar
0
abpnewtonvisionco created
  • ABP Framework version: v7.2.2
  • UI Type: Angular
  • Database System: EF Core (SQL Server)
  • Auth Server Separated (for Angular): yes
  • Steps to reproduce the issue:

We've been having issues with the DB migrator when deploying to another environments, even though the migrations table has all the correct migrations listed in it, when we move to another environment it does not add the changes to the new data base. The process that we usually have is that once the migrations are added and tested in local environment, we move the code to another environment and run the DBMigrator project.

Is there something that we are missing? Perhaps we are doing it in the wrong order?


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

    Hello abpnewtonvisionco,

    Check connection string in DB migrator and Host--> appsetting.json, Connection string should be same at both places.

    1. Do add migration
    2. then do update migration.
    3. then check migration file, if it is updated or not. (if any new changes are there in EF for migration then this creates the migration file and it should not be empty).
    4. And if the file is not empty then run the DB migrator project. This should reflect your DB migration changes.

    just to confirm, are you running this through any pipelines..or you are connecting to different environment locally ?

  • User Avatar
    0
    abpnewtonvisionco created

    Hi Anjali_Musmade , thanks for answering.

    We used to do run the db migration through a pipeline, but when we detected issues we started doing it manually (This means we use a local pc and point to the desired database).

    Got it, we will review again our process, we just wanted to check if we were doing something wrong, or maybe a wrong order on how they should be done.

  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello abpnewtonvisionco,

    Please let us know if any particular error occurs when you follow above mentioned steps or if you have modified some steps to suit your requirement and got some error or it worked for you.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 05, 2024, 12:19