← all rules

require-columns

warning

Missing required column

Why it's unsafe

A CREATE TABLE is missing a column the policy requires (e.g. created_at). A later ALTER TABLE … ADD COLUMN in the same migration also satisfies it.

Safe rewrite

Add the column to the CREATE TABLE (or a later ALTER TABLE … ADD COLUMN in the same migration), or remove it from required-columns in your config.

Example

Try it in the playground →

Unsafe

CREATE TABLE orders (id bigint PRIMARY KEY);

Safe

CREATE TABLE orders (id bigint PRIMARY KEY, created_at timestamptz NOT NULL);

Related