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

Rename with legacy_alter_table on

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

What it catches

With PRAGMA legacy_alter_table=ON, RENAME TABLE and RENAME COLUMN go back to the pre-3.26 behaviour: references inside views and triggers are not rewritten. The rename succeeds, and the first query through a view that named the old table fails with "no such table".

Fires on

PRAGMA legacy_alter_table = ON;
ALTER TABLE orders RENAME TO purchases;

Do this instead

Leave legacy_alter_table off (the default) so SQLite rewrites views and triggers with the rename. If the pragma is on for a specific rebuild step, switch it off before any rename.

PRAGMA legacy_alter_table = OFF;
ALTER TABLE orders RENAME TO purchases;
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