Skip to content

MG20 — Transaction opened but never committed or rolled back

Group: Migration safety · Auto-fixable: no

A BEGIN/START without a matching COMMIT/ROLLBACK leaves the migration in an open transaction. Close every transaction you open.

bad: BEGIN; ALTER TABLE t ADD COLUMN c int;
good: BEGIN; ALTER TABLE t ADD COLUMN c int; COMMIT;

Disable this rule in banshee.toml:

[lint]
exclude = ["MG20"]

Or silence one line with -- noqa: MG20. See Linting.