Theory of Intelligence
BACKEND ENGINEERING•Databases Concurrency And Caching•Relational Databases•1.4 Migrations

1.4.1 Database Migrations

Subtopics: Database Migrations and Schema Versioning.

1.4.1 Database Migrations

A migration is a named change: add column, new index, backfill. Tools (Alembic, Flyway, Prisma) apply them in order and record what ran.

Why it matters

App code and schema must move together. Ad-hoc ALTER TABLE on prod is how you lose a weekend.

How it is used

Expand/contract: add a nullable column, deploy code that writes both old and new, backfill, then drop the old column in a later release. Never rename a live column in one step.

Discuss theoretical concepts, mathematical formulas, and architectural foundations.

Supports inline code with `backticks`
No comments yet. Be the first to start the discussion!