no-migration-comments
Encode migration invariants in SQL instead of explanatory comments.
Why
Comments that describe bounds or allowed states leave those invariants unenforced, while SQL CHECK, NOT NULL, UNIQUE and foreign-key constraints reject invalid writes from every caller.
Fix
Express data invariants with SQL constraints and delete explanatory line/block comments and COMMENT ON statements that store prose. COMMENT ON with NULL or an empty string may remove existing comments. Put deployment context in the change description. Retain only executable runner, dialect, statement-boundary directives, and scoped timeout-justification directives bound to a matching timeout statement. Migration sarj-noqa comments are also reported.
Examples
CREATE TABLE IF NOT EXISTS settings (retries INTEGER);
-- retries must be positive-- migrate:upCREATE TABLE IF NOT EXISTS settings (retries INTEGER CHECK (retries > 0));
-- migrate:downDROP TABLE IF EXISTS settings;SELECT 1 /**/ AS value;SELECT 1 AS value;Autofix output
SELECT 1 AS value;SELECT 'payload' AS label, 1 /**/ AS value;SELECT 'payload' AS label, 1 AS value;Autofix output
SELECT 'payload' AS label, 1 AS value;-- DROP TABLE legacy;SELECT 1;SELECT 1;Autofix output
SELECT 1;