postgres/squawk
Checks every migration for changes that lock or rewrite a table, or break the running application.
Part of the postgres configuration, at the recommended level. It runs at the commit stage, per file. It runs squawk.
A migration that takes an exclusive lock on a large table stops the application for as long as it runs.
What to do
Section titled “What to do”Follow the advice squawk prints for the rule. Turn one rule off with gspot ignore postgres/squawk --rule <name> --reason "<why>".
Example
Section titled “Example”A migration that adds a constraint with a full table scan reports a finding. Create the constraint first, and validate it in a separate migration.
Turn it off
Section titled “Turn it off”Turn it off for some files, or one of its lint rules, with a reason:
gspot ignore postgres/squawk --paths "<glob>" --reason "<why>"gspot ignore postgres/squawk --rule <rule> --reason "<why>"