Your Docusaurus site did not load properly.

A very common reason is a wrong site baseUrl configuration.

Current configured baseUrl = / (default value)

We suggest trying baseUrl =

Squawk

A linter for Postgres migrations

Prevent Downtime

Lint your schema changes and prevent blocking reads / writes.

GitHub Integration

Use the Squawk GitHub App to lint your pull requests.

Open Source

squawk is open source and written in Rust. Install it with npm install squawk-cli.

Rules

Prevent schema mistakes

rule namedescription
ban-char-fieldPrevent mistaken use of character type in schema.
prefer-big-intPrevent hitting the 32 bit max int limit.
prefer-identitySerial types have confusing behaviors. Use identity columns instead.
prefer-timestamptzEnsure consistent timezone handling for timestamps, regardless of your database session timezone.

Make backwards compatible schema changes

rule namedescription
ban-drop-databasePrevent breaking existing clients that depend on the database.
changing-column-typePrevent breaking existing clients that depend on column type. Prevent blocking reads/writes to table while table is rewritten.
renaming-columnPrevent breaking existing clients that depend on column.
renaming-tablePrevent breaking existing clients that depend on table.

Apply schema changes safely

rule namedescription
adding-field-with-defaultPrevent blocking reads/writes to table while table is rewritten on PG < 11.
adding-foreign-key-constraintPrevent blocking writes to tables while verifying foreign key constraint.
adding-not-nullable-fieldPrevent blocking reads/writes to table while table is scanned on PG < 11.
adding-serial-primary-key-fieldPrevent blocking reads/writes to table while index is built.
changing-column-typePrevent breaking existing clients that depend on column type. Prevent blocking reads/writes to table while table is rewritten.
constraint-missing-not-validPrevent blocking writes to the table while the scan occurs.
disallowed-unique-constraintPrevent blocking reads/writes to table while index is built.
prefer-robust-stmtsEnsure migrations are atomic or retriable.
prefer-text-fieldPrevent blocking reads and writes to table while table metadata is updated.
require-concurrent-index-creationPrevent blocking writes to table while index is created.
require-concurrent-index-deletionPrevent blocking reads/writes to table while index is dropped.