idempotent-ddl
DDL omits a supported IF [NOT] EXISTS guard.
Why
Supported existence guards help replay DDL after partial application. A transactional migration runner such as dbmate owns version tracking and rollback; this rule does not require every statement to be independently replayable.
Fix
Use the native IF NOT EXISTS or IF EXISTS form where this rule supports it. Keep ADD CONSTRAINT as plain DDL in versioned transactional migrations; do not synthesize catalog-query DO blocks or catch duplicate-object errors solely for replay.
Examples
CREATE TABLE orders (id BIGINT PRIMARY KEY);CREATE TABLE IF NOT EXISTS orders (id BIGINT PRIMARY KEY);