简体   繁体   中英

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 ie 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

In your migration.config.ts file change to:

export const AppDataSource: Datasource = new DataSource({...})

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM