#12912·typeorm

docs: explain how to review PostgreSQL migration lock risk

Author: flvmntCreated Sep 29, 2026Updated Sep 29, 2026

What was unclear or otherwise insufficient?

The Migrations documentation explains how to create and run migrations, but does not show PostgreSQL users how to inspect the lock impact of raw SQL in queryRunner.query() before deploying it. An ALTER COLUMN TYPE can hold an ACCESS EXCLUSIVE lock during a rewrite, and a non-concurrent index build blocks writes.

Recommended fix

Add a short, optional migration-safety reference under Migrations. It should give a command for analyzing static SQL in TypeORM migration files and state the limits clearly: dynamic SQL and TypeORM schema-builder calls may not be analyzable. PR #12547 proposes such a page using pgfence.

Additional context

I maintain pgfence. This request is for documentation of an external tool, not built-in TypeORM migration checks. The proposed page is scoped to PostgreSQL and does not change TypeORM behavior.

Are you willing to resolve this issue by submitting a Pull Request?

Yes, I have the time, and I know how to start. PR #12547 is open.