-
I apoligize if this is a simple question, but I have a project I have been working on on my local machine, adding and running migrations, and now I am ready to deploy. The problem is, my prod db is still 5 migrations behind, but my schema.rs is up to the latest migration. How would you recommend syncing these two? I can't run the reverts because the changes in the DB of the most recent migrations don't exist in prod to be undone. Is there some way to do |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
The correct way to sync those two states is to apply the missing 5 migrations to your production database before deploying the new version. This can be done via diesel-cli or via the
That's not required, as you can and should take the existing migrations for that. |
Beta Was this translation helpful? Give feedback.
The correct way to sync those two states is to apply the missing 5 migrations to your production database before deploying the new version. This can be done via diesel-cli or via the
embed_migration!()
macro and then running migrations on startup. Depending on your uptime requirements you might do some fancy steps here, or just shut down the old applications, apply the migrations and start the new application.