Chapter 20 · Part 4

Database Schema Migration

A focused chapter on database schema migration, with practical delivery concerns, trade-offs, and the operational questions behind CI/CD work.

20-1

Why Database Schema Changes Need the Same Discipline as Code

Imagine this: your team has just deployed a new feature. The application code is running fine. But five minutes later, errors start pouring in. A column

5 min
20-2

Writing Database Migration Scripts That Won't Blow Up Production

You have a new feature ready. The code is reviewed, tested, and merged. But there is one thing standing between you and deployment: a database change

5 min
20-3

When Your Database Schema Needs Version Control Too

Imagine this: your team has a solid CI/CD pipeline for the application code. Every pull request triggers automated tests, builds a container image, and

6 min
20-4

Additive Database Changes: How to Add Without Breaking Production

You have a running application with thousands of active users. Your team needs to add a phone number field to the user profile. The change seems small

6 min
20-5

When Deleting a Database Column Breaks Production: Managing Destructive Schema Changes

You have a database migration that removes an unused column. The SQL looks clean. The migration runs without errors. But five minutes later, alerts start

5 min
20-6

When Adding an Index Freezes Your Application

Your team has been tracking a slow query for weeks. The users table has grown to millions of rows, and searching by email now takes seconds instead of

4 min
20-7

When Database Migrations Break Running Applications

Your team has just deployed a new feature. The rollout looks clean. But five minutes later, the on-call engineer sends a screenshot of error logs. Old

5 min
20-8

Why Your Database Migration Needs More Than a Developer Laptop Test

You have a migration script that runs perfectly on your laptop. The syntax is correct, the new column appears, and the test data fits neatly into the new

6 min