How we use migrations during early product development

When the schema changes quickly

Joel Clermont
Joel Clermont
2024-02-20

When building a new app, we like to keep all migrations in a single file called initial_migration.

The schema is going to change a lot in the early build out of the app, so instead of accumulating dozens of migration files, we just make edits to that initial migration and use migrate:fresh to rebuild.

Every little bit keeps those tests running faster.

Of course, once we go live, we go back to always writing a new migration file for schema changes. We're not monsters.

Here to help,

Joel

P.S. Would you like two pros to build out your next Laravel app?

Toss a coin in the jar if you found this helpful.
Want a tip like this in your inbox every weekday? Sign up below 👇🏼

Level up your Laravel skills!

Each 2-minute email has real-world advice you can use.