Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mass6's avatar

How does Envoyer handle migration rollbacks?

I was wondering if anyone can tell me how Envoyer handles migration rollbacks, if at all?

Suppose my new deployments includes some new DB table migrations, and a few column additions to existing tables. If I discover a bug after deployment and I want to rollback the system to the state of the previous deployment, will the db changes/migrations be removed as well?

0 likes
3 replies
DMA's avatar

Bump, I'd also like to know how this could work.

fideloper's avatar

Envoy doesn't run any migrations for you automatically - any extra steps, such as a migration, can either:

  1. Be done manually after a deployment
  2. Be done using Envoyer's feature which lets you add before/after commands to run after the deployment steps

You can add a pre/post hook to call php artisan migrate

Rollbacks, however, are done via "re-deploying" an old release in your list of deployments. Unfortunately, there's no real distinction between a deploy and rollback, so running php artisan migrate:rollback is something you'll have to do manually I think (ssh into server and run the migrate:rollback command).

1 like
browner12's avatar

i guess one thing to help alleviate this is make sure your php aritsan migrate is as late into the deployment process as possible, so other problems won't affect it as much.

Please or to participate in this conversation.