Skip to content
Latchkey

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.

psql
No migrations are pending
# but later:
QueryFailedError: column "status" of relation "orders" does not exist

Common 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.

data-source.ts
migrations: [__dirname + '/migrations/*.{ts,js}'],
// or run TS directly with ts-node and a .ts glob

Generate or build the missing migration

  1. Run migration:generate after entity changes and commit the result.
  2. Build TypeScript migrations before migration:run in CI.
  3. Verify with migration:show that 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".

Frequently asked questions

What causes ""No migrations are pending""?
The migrations path points at .ts files while the runtime loads .js (or vice versa), so no migration files are discovered.
How do I fix "No migrations are pending"?
Point the data source at the files that actually exist at runtime.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card