From ba42803de18a274a8f569b80e159de231bd27ba5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Koskim=C3=A4ki?= Date: Wed, 11 May 2022 18:25:59 +0300 Subject: [PATCH] fixes #93 --- package.json | 2 +- src/dialect/mysql/mysql-introspector.ts | 8 ++------ src/migration/migrator.ts | 2 ++ test/node/src/migration.test.ts | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index d1f49b7cf..f3fedb0a9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kysely", - "version": "0.19.1", + "version": "0.19.2", "description": "Type safe SQL query builder", "repository": { "type": "git", diff --git a/src/dialect/mysql/mysql-introspector.ts b/src/dialect/mysql/mysql-introspector.ts index 9055b85d1..f666face0 100644 --- a/src/dialect/mysql/mysql-introspector.ts +++ b/src/dialect/mysql/mysql-introspector.ts @@ -12,6 +12,7 @@ import { import { Kysely } from '../../kysely.js' import { ColumnDataType } from '../../operation-node/data-type-node.js' import { freeze } from '../../util/object-utils.js' +import { sql } from '../../raw-builder/sql.js' export class MysqlIntrospector implements DatabaseIntrospector { readonly #db: Kysely @@ -42,12 +43,7 @@ export class MysqlIntrospector implements DatabaseIntrospector { 'is_nullable', 'data_type', ]) - .where('table_schema', 'not in', [ - 'information_schema', - 'performance_schema', - 'mysql', - 'sys', - ]) + .where('table_schema', '=', sql`database()`) .castTo() if (!options.withInternalKyselyTables) { diff --git a/src/migration/migrator.ts b/src/migration/migrator.ts index 000d627d4..f01ff4bf2 100644 --- a/src/migration/migrator.ts +++ b/src/migration/migrator.ts @@ -628,6 +628,8 @@ export interface MigratorProps { * If you do specify this, ALWAYS ALWAYS use the same value from the beginning of * the project, to the end of time or prepare to manually migrate the migration * tables. + * + * This only works on postgres. */ readonly migrationTableSchema?: string } diff --git a/test/node/src/migration.test.ts b/test/node/src/migration.test.ts index c7b5505f2..194dc6003 100644 --- a/test/node/src/migration.test.ts +++ b/test/node/src/migration.test.ts @@ -433,7 +433,7 @@ for (const dialect of BUILT_IN_DIALECTS) { }) }) - if (dialect !== 'sqlite') { + if (dialect === 'postgres') { describe('custom migration tables in a custom schema', () => { it('should create custom migration tables in custom schema', async () => { const [migrator, executedUpMethods] = createMigrations(