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

schachfeld's avatar

Modify migration files in staging

So I have a discussion with a developer on how you should be able to modify migrations. Of course, once you deployed the changes to the production, you should not at all edit your migration files. But is this true for staging?

In my opinion every time you deploy to the staging server, the database should be migrated from scratch and then be filled with test data via a seeder (or something else).

Or am I completely wrong and you should not touch your migrations once you pushed them to the remote repository?

0 likes
1 reply
MichalOravec's avatar

I think it depends if you don't want to lose your data. But usually you should make new migration for every change in your database schema.

Please or to participate in this conversation.