Migrations

Migrations

Reviewed SQL files from one schema catalog to the next, then plan, lint, and apply per target.

A migration is reviewed SQL from one catalog snapshot to the next. Generate writes the file; plan prints the steps; apply runs them on a target; check reports live drift.

Start with First migration when the database is empty. An existing database starts at Existing database. A Drizzle schema starts at From Drizzle.

PageYou use it for
Existing databasePull, generate, then baseline without replaying DDL.
From DrizzleImport a Drizzle schema into okmodel tables.
LintReplay history in a scratch schema and read the lint codes.
BackfillA data step that resumes by primary key.
FailuresWhat a failed step leaves behind, and how to resolve it.
EnvironmentsPreview and rehearsal targets.