PostgreSQL 17 runners are live
All rules

FRN706[high]History

Migrations don't match schema.hcl

The schema the migrations build differs from the one declared in schema.hcl.

Why it's risky in PostgreSQL

When the migration folder has a schema.hcl, Fronelta builds the schema it declares and compares it with what the migrations build after this pull request. Each table, column, constraint, index or enum that exists on only one side, or is defined differently, is reported on its line.

Keep both in the same pull request: change schema.hcl and add the migration that gets there. Views, functions and triggers aren't part of schema.hcl and aren't compared. The format is described in SCHEMA_HCL.md.

What triggers it, and the safer way

unsafe.sql
# schema.hcl declares orders.note, but no migration adds it
table "orders" {
  column "id"   { type = "bigint" }
  column "note" { type = "text" }
}
safer.sql
-- with it, the migration that adds the column:
ALTER TABLE orders ADD COLUMN note text NOT NULL DEFAULT '';

Suppress it when you're sure

Put this comment on the line before the statement. The reason is required and shows in the report.

suppression
-- fronelta:allow FRN706 <why this is safe here>

Applies to PostgreSQL 14, 15, 16, 17.