Transactional DDL Rollback
PostgreSQL supports transactional schema updates. dbmigrate groups statements into atomic phases. If a constraint or type alteration fails, the entire transaction rolls back automatically, leaving zero partial drift behind.
BEGIN;ALTER TABLE app.orders ADD COLUMN status varchar(32) NOT NULL DEFAULT 'pending';
CREATE INDEX idx_orders_status ON app.orders (status);
COMMIT; -- Rolls back entirely if any statement fails