Encoding rules from Braintree’s “Safe Operations for High Volume PostgreSQL and “PostgreSQL at Scale: Database Schema Changes Without Downtime” as Postgres migration linter rules using pg_query.
❯ docker run -v $(pwd)/testdata:/testdata deliveroo/migratelint:1.0.0 check /testdata/*.sql
/testdata/add_column_with_unique_constraint.sql => New columns with unique constraints are unsafe.
/testdata/add_multiple_columns_with_violation.sql => Type changes on existing columns are unsafe.
/testdata/alter_existing_column_type.sql => Type changes on existing columns are unsafe.
/testdata/create_index_without_concurrently.sql => Indexes must be created with CONCURRENTLY.
/testdata/create_table_with_index.sql => Indexes must be created with CONCURRENTLY.