Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions src/migration/migrator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,12 +386,6 @@ export class Migrator {
async #ensureMigrationTableExists(): Promise<void> {
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)
Expand Down Expand Up @@ -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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated the relevant test and tested it manually in my project that is using Kysely. Is there anything else that I need to check to confirm that migrationTableSchema works with mssql?

*/
readonly migrationTableSchema?: string

Expand Down
2 changes: 1 addition & 1 deletion test/node/src/migration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down