-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Labels
new checkNew SQL checkNew SQL check
Description
SERIAL and its variants are pseudo-types that are not standard SQL. They have known issues with permission management (the sequence is owned separately), pg_dump behavior, and logical replication. PostgreSQL 10 introduced GENERATED BY DEFAULT AS IDENTITY as the standard replacement.
-- Flagged
CREATE TABLE events (id BIGSERIAL PRIMARY KEY);
-- Safe alternative
CREATE TABLE events (id BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY);Note: diesel-guard already has AddSerialColumnCheck which flags ALTER TABLE ADD COLUMN ... SERIAL. This new check would cover CREATE TABLE as well and expand the recommendation to prefer identity columns.
Review the Contribution Guide before adding a new check. It covers the architecture, implementation patterns, and step-by-step instructions.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
new checkNew SQL checkNew SQL check
Projects
Status
In progress