Skip to content

MG01 — CREATE INDEX without CONCURRENTLY locks the table

Group: Migration safety · Auto-fixable: yes

A plain CREATE INDEX takes a lock that blocks writes for the whole build. On a large table that can mean a long outage. Build it CONCURRENTLY (outside a transaction block).

bad: CREATE INDEX idx ON t (a);
good: CREATE INDEX CONCURRENTLY idx ON t (a);

Disable this rule in banshee.toml:

[lint]
exclude = ["MG01"]

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