Schema Migrations

Difficulty: Intermediate

Question

How do you handle schema changes in production?

Answer

Use migration scripts (versioned SQL files), test in staging first, and try to make changes backwards compatible (e.g., add column, migrate data, THEN delete old column).

Concepts covered

Version Control, Production