mixed-migration-phases
Review existing-table migrations that combine backfill, enforcement, and contract phases.
Why
Combining data movement with destructive or enforcing schema changes removes deployment checkpoints and makes lock duration, rollback, and compatibility harder to control.
Fix
Split expand, backfill, enforcement, and contract work into independently deployable migrations, or document why atomic execution is required together with lock, runtime, rollback, and postcondition evidence.
Examples
ALTER TABLE credentialADD COLUMN token TEXT;
UPDATE credentialSET token = legacy_token;
ALTER TABLE credentialDROP COLUMN legacy_token;CREATE TABLE status (id UUID PRIMARY KEY, name TEXT NOT NULL);
INSERT INTO statusVALUES ('00000000-0000-0000-0000-000000000001', 'ready');
CREATE INDEX status_name_idx ON status (name);