Skip to content

MG15 — Prefer GENERATED ... AS IDENTITY over serial

Group: Migration safety · Auto-fixable: no

serial and bigserial are legacy pseudo-types that create a detached sequence with awkward ownership and grants. Prefer a standard identity column.

bad: id bigserial PRIMARY KEY
good: id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY

Disable this rule in banshee.toml:

[lint]
exclude = ["MG15"]

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