diff --git a/src/migration/migrator.ts b/src/migration/migrator.ts index e65a2be7b..b1ed68539 100644 --- a/src/migration/migrator.ts +++ b/src/migration/migrator.ts @@ -386,12 +386,6 @@ export class Migrator { async #ensureMigrationTableExists(): Promise { if (!(await this.#doesTableExists(this.#migrationTable))) { try { - if (this.#migrationTableSchema) { - await this.#createIfNotExists( - this.#props.db.schema.createSchema(this.#migrationTableSchema), - ) - } - await this.#createIfNotExists( this.#props.db.schema .withPlugin(this.#schemaPlugin) @@ -799,7 +793,7 @@ export interface MigratorProps { * the project, to the end of time or prepare to manually migrate the migration * tables. * - * This only works on postgres. + * This only works on postgres and mssql. */ readonly migrationTableSchema?: string diff --git a/test/node/src/migration.test.ts b/test/node/src/migration.test.ts index bc93dce3f..c478643f1 100644 --- a/test/node/src/migration.test.ts +++ b/test/node/src/migration.test.ts @@ -970,7 +970,7 @@ for (const dialect of DIALECTS) { }) }) - if (dialect === 'postgres') { + if (dialect === 'postgres' || dialect === 'mssql') { describe('custom migration tables in a custom schema', () => { it('should create custom migration tables in custom schema', async () => { const [migrator, executedUpMethods] = createMigrations(