TypeORM "No migrations are pending" Mismatch in CI
TypeORM reports "No migrations are pending" yet the schema does not match your entities. Usually the migrations glob resolves nothing (uncompiled or wrong path), so TypeORM sees no migrations to run and believes it is up to date. This is deterministic.
What this error means
migration:run says nothing is pending while queries still fail on missing columns/tables, or a schema:log/migration:generate diff is non-empty. The migrations are effectively invisible to TypeORM.
No migrations are pending
# but later:
QueryFailedError: column "status" of relation "orders" does not existCommon causes
Migrations glob resolves nothing
The migrations path points at .ts files while the runtime loads .js (or vice versa), so no migration files are discovered.
Migrations not compiled
TypeScript migrations were not built, so the compiled output the data source expects does not exist.
Entities changed without a migration
An entity changed but no migration was generated, so there is genuinely nothing pending even though the schema is behind.
How to fix it
Fix the migrations glob to match runtime
Point the data source at the files that actually exist at runtime.
migrations: [__dirname + '/migrations/*.{ts,js}'],
// or run TS directly with ts-node and a .ts globGenerate or build the missing migration
- Run
migration:generateafter entity changes and commit the result. - Build TypeScript migrations before
migration:runin CI. - Verify with
migration:showthat the expected files are listed.
How to prevent it
- Keep the migrations glob aligned with how migrations are executed in CI.
- Generate a migration for every entity change and commit it.
- This is deterministic - retrying without fixing discovery shows the same false "no pending".