Skip to content
Web Design & Development

Database Migrations: The Decisions That Matter

Version-controlled scripts that change a database's structure step by step, so every environment's schema can be created and updated consistently.

MediaScaleUp Editorial Team 2 min read 13 views
Database Migrations: The Decisions That Matter

Where most projects go wrong

The usual mistakes:

  • Manual schema changes in production
  • Destructive migrations without backups
  • Editing old migrations after deployment
  • Long locks on busy tables

What good looks like instead

  • Review migrations like application code
  • Test migrations on production-sized data
  • Back up before running risky migrations
  • Split large changes into safe steps
  • Avoid editing migrations already run in production
What to do and what to avoid with database migrations, side by side
Good practice against the usual mistakes, from the sources listed below.

Why it matters

Migrations make schema changes reviewable and repeatable, and careless migrations can lock tables or lose data in production.

The specs that matter

Published figures for Database Migrations
MeasureFigure
Version controlmigrations live alongside application code
Up and downmigrations can apply and reverse changes
Laravelprovides a migration system and schema builder
Production risklarge table changes can lock tables

Knowing when to hand it over

Tip: Bring in help when changing large production databases.

Where this comes from

The figures and practices above come from the sources listed.

Working on something like this?

We take on Web Design & Development work for teams who want it done once, properly. Tell us what you are building and we will tell you honestly whether we are the right studio for it. Start a project.

Where to go next

Spotted something wrong? Report an error on this page. We correct on the page and say what changed.

All services

The work behind this article, and what it costs.

MediaScaleUp Editorial Team

Articles here are researched, written and checked by the MediaScaleUp studio team before they are published, and dated when they are reviewed.

Keep reading

More in Web Design & Development