prefer-constrained-status
Review CHECK-constrained boolean states for a single status column.
Why
A CHECK that rules out combinations of multiple required booleans exposes a shared state contract. A constrained status column can represent the permitted states explicitly and avoid invalid flag combinations.
Fix
Review whether these dependent booleans represent one lifecycle. Retain an authoritative Boolean when one bit determines the rest; use one constrained status for a multiway lifecycle. Preserve every valid combination, independent field, external contract and application transition.
Examples
CREATE TABLE job ( requested BOOLEAN NOT NULL, confirmed BOOLEAN NOT NULL, CHECK ( NOT confirmed OR requested ));CREATE TABLE job ( enabled BOOLEAN NOT NULL, archived BOOLEAN NOT NULL);CREATE TABLE job ( requested BOOLEAN NOT NULL, confirmed BOOLEAN NOT NULL, archived BOOLEAN NOT NULL, CHECK ( NOT confirmed OR requested ), CHECK ( NOT archived OR confirmed ));CREATE TABLE job ( status TEXT NOT NULL CHECK ( status IN ('new', 'requested', 'confirmed', 'archived') ));CREATE TABLE job ( requested BOOLEAN NOT NULL, confirmed BOOLEAN NOT NULL, muted BOOLEAN NOT NULL, CHECK ( ( NOT confirmed OR requested ) AND ( muted OR NOT muted ) ));CREATE TABLE job ( status TEXT NOT NULL CHECK (status IN ('new', 'requested', 'confirmed')), muted BOOLEAN NOT NULL);