DROP COLUMN rewrites the table
Warning — it works, but holds the single write lock or breaks the previous release.
What it catches
DROP COLUMN edits the schema and then rewrites every row of the table to purge the column's values — one write transaction that holds the database's single write lock for the length of the copy. It also fails outright if anything else in the schema names the column (an index, a foreign key, a view, a trigger, a generated column) and is unsupported before SQLite 3.35.
Fires on
ALTER TABLE orders DROP COLUMN legacy_flag;Do this instead
Stop reading the column in code first, let a release soak, and drop it in a scheduled migration — SQLite's write lock means every other writer waits for the rewrite. If the column is indexed or referenced, drop those objects first or the statement fails.
-- release N: remove every code reference to legacy_flag
-- release N+1, scheduled:
-- DROP INDEX IF EXISTS orders_legacy_flag;
-- ALTER TABLE orders DROP COLUMN legacy_flag; 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