#2640·typeorm

Migrations does not respect custom NamingStrategy

Author: erencayCreated Aug 8, 2018Updated Sep 23, 2026
Labelsbugcomp: migrationscomp: namingdriver: mysqldriver: mariadb

Issue type: [x] bug report

Database system/driver: [x] mysql / mariadb

TypeORM version: [x] latest

Steps to reproduce or a small repository showing the problem:

(async function() {
    const conn = await createConnection({
        ...
        namingStrategy: new MyNamingStrategy(),
    });
    await new MigrationExecutor(conn).executePendingMigrations();
})();

I want to create indexes with custom names. When I set a custom NamingStrategy and turn on the synchronize option, synchronization creates indexes accordingly.

But migration tool ignores MyNamingStrategy defined in ormconfig.js. Even programmatically executed migrations won't work.