Black Friday: the Laravel testing course is $149 instead of $249, through Dec 7. See the course →
logo

How we use migrations during early product development

When the schema changes quickly

Joel Clermont
Joel Clermont
2024-02-20

From our daily Laravel tips email. Get the next one in your inbox.

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?

Want a tip like this in your inbox every weekday?

Each one takes less than 2 minutes to read. Join 4,000+ Laravel developers who already get them.

email
No spam. Only real-world advice.
Toss a coin in the jar if you found this helpful.