All rules Rule SL007 · DW
SQLite · alpha
warning
DW · Deploy window
free in the CLI — --engine=sqlite

RENAME COLUMN or RENAME TABLE during a deploy

Warning — it works, but holds the single write lock or breaks the previous release.

What it catches

A rename is instant in SQLite, and that is the problem: the moment it commits, every process still running the previous release fails on the old name. Views and triggers are rewritten to the new name, but application SQL is not.

Fires on

ALTER TABLE orders RENAME COLUMN qty TO quantity;

Do this instead

Expand and contract: add the new column, dual-write from the application, backfill, switch readers, then drop the old column in a later release. For a table, create the new one, copy, and swap only when no deployed code reads the old name.

ALTER TABLE orders ADD COLUMN quantity INTEGER;
-- dual-write from the application; backfill in batches
-- later release, after readers moved:
--    ALTER TABLE orders DROP COLUMN qty;
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