SQLite · alpha
critical
CN · Constraints & keys
free in the CLI — --engine=sqlite
ADD COLUMN with PRIMARY KEY or UNIQUE
Critical — SQLite refuses the statement, so the migration fails here.
What it catches
ALTER TABLE ADD COLUMN cannot carry a PRIMARY KEY or UNIQUE constraint — SQLite rejects the statement outright ("Cannot add a PRIMARY KEY column", "Cannot add a UNIQUE column"). The migration fails, and the constraint it wanted still does not exist.
Fires on
ALTER TABLE orders ADD COLUMN external_id TEXT UNIQUE;Do this instead
Add the column plain, then create the unique index as its own statement — that is what UNIQUE would have built anyway. A new primary key needs the table rebuilt: create the new table, copy, drop, rename.
ALTER TABLE orders ADD COLUMN external_id TEXT;
CREATE UNIQUE INDEX orders_external_id ON orders (external_id);Catch this before it ships
SQLite support is in alpha: this rule runs locally in the free CLI, static only, and not in the hosted service yet: npx bolvrk check migration.sql --engine=sqlite