TypeORM's default migrationsTransactionMode is all: every migration runs in one shared transaction. A migration that calls queryRunner.connection.createQueryRunner() opens a separate pooled connection that cannot see uncommitted tables created earlier in the run (this is exactly the fix-invoice-number-sequence failure fixed in #1195).
This is a footgun for future migrations: any migration that uses connection.createQueryRunner() (or does SELECT on tables created by an earlier migration in the same run) will fail from scratch.
Fix: document the constraint in the migrations README (prefer the passed queryRunner), and/or audit existing migrations for createQueryRunner() usage.
TypeORM's default
migrationsTransactionModeisall: every migration runs in one shared transaction. A migration that callsqueryRunner.connection.createQueryRunner()opens a separate pooled connection that cannot see uncommitted tables created earlier in the run (this is exactly thefix-invoice-number-sequencefailure fixed in #1195).This is a footgun for future migrations: any migration that uses
connection.createQueryRunner()(or doesSELECTon tables created by an earlier migration in the same run) will fail from scratch.Fix: document the constraint in the migrations README (prefer the passed
queryRunner), and/or audit existing migrations forcreateQueryRunner()usage.