How to remove deleted typeorm migration files from migration list

Viewed 1557

ran typeorm migration:generate -n <name>, but generated migration files did not run due to some issues, deleted the generated file and created another migration file and try to run the migration, but it gets blocked by the same migration file i deleted. I ran typeorm migration:show to get list of migrations, saw the deleted migration files and that is blocking my other migrations, can someone help me how to fix this.

More details: There were migration info stored in my database but not the deleted migration file. Don't know where typeorm is pull the files from. Cache disabled

2 Answers

Check you dist folder or whatever your folder name which has been created from build. In my case the migration folder from dist containing the pending migrations and blocking my new migrations to run.

In your TypeORM.config file, check which (path) your migration is pointing to and you will find the folder where the build migration is stored.

{
    type: "mysql",
    host: "localhost",
    port: 3306,
    username: "test",
    password: "test",
    database: "test",
    entities: [/*...*/],
    migrations: [/*...*/],
    migrationsTableName: "custom_migration_table",
}
Related