Skip to content

MG11 — Prefer bigint over a narrower integer for a primary key

Group: Migration safety · Auto-fixable: no

An int or smallint primary key can run out of values as a table grows, and widening a primary key later is an expensive, locking migration. Use bigint from the start.

bad: id int PRIMARY KEY
good: id bigint PRIMARY KEY

Disable this rule in banshee.toml:

[lint]
exclude = ["MG11"]

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