Skip to content
Latchkey

TypeORM "No migrations are pending" in CI

TypeORM compares the migrations it can load against the migrations table and applies the difference. "No migrations are pending" means it sees nothing to run, usually because it never loaded your migration files in the CI environment.

What this error means

typeorm migration:run prints "No migrations are pending" and exits 0, even though you added a migration that has not been applied to this database.

typeorm output
No migrations are pending

Common causes

The migrations glob matches compiled paths that do not exist

The DataSource migrations glob points at dist/**/*.js, but CI runs from TypeScript without building, so no migration files are loaded.

The migration is already recorded as run

The migrations table already has a row for it (for example from a seeded database), so TypeORM correctly considers it applied.

How to fix it

Match the migrations glob to what CI runs

  1. If CI runs TypeScript directly, point the glob at the .ts sources and run with ts-node.
  2. If CI builds first, point it at the compiled .js output and ensure the build ran.
  3. Re-run migration:run and confirm the file is now detected.
data-source.ts
export const AppDataSource = new DataSource({
  // running TS directly in CI:
  migrations: ['src/migrations/*.ts'],
});

Run against a clean database

Start CI migrations from an empty database so the migrations table does not already contain the rows you expect to apply.

How to prevent it

  • Keep the migrations glob aligned with whether CI runs TS or compiled JS.
  • Run migrations against a fresh database in CI.
  • Build before running migrations when the glob targets dist.

Frequently asked questions

What causes "TypeORM "No migrations are pending""?
The DataSource migrations glob points at dist/**/*.js, but CI runs from TypeScript without building, so no migration files are loaded.
How do I fix TypeORM "No migrations are pending"?
Match the migrations glob to what CI runs

Related guides

References

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