Search code examples
postgresqlmigrationnestjstypeorm

Can't run Typeorm migrations in nestjs


I was following this blog https://wanago.io/2022/07/25/api-nestjs-database-migrations-typeorm/ to setup migrations in my nestjs project but got the error that dataSourceFileExport i.e DataSource object exported from the migration.config.ts is not iterable. And I don't know why it's not iterable. I couldn't find the solution on any platform

Error in the terminal

migration.config.ts

migration scripts


Solution

  • This is a known issue introduced in TypeORM v0.3.8 and fixed in v0.3.9