diff --git a/.changeset/fix-prisma-logging.md b/.changeset/fix-prisma-logging.md new file mode 100644 index 00000000000..973d7cb13b5 --- /dev/null +++ b/.changeset/fix-prisma-logging.md @@ -0,0 +1,5 @@ +--- +'@keystone-6/core': patch +--- + +Fix `config.db.enableLogging` types to align with Prisma 5 diff --git a/packages/core/src/types/config/index.ts b/packages/core/src/types/config/index.ts index 9aaac573aee..636d6e2ea8c 100644 --- a/packages/core/src/types/config/index.ts +++ b/packages/core/src/types/config/index.ts @@ -108,7 +108,7 @@ export type KeystoneConfig) => Promise - enableLogging?: boolean | PrismaLogLevel | Array + enableLogging?: boolean | Array idField?: IdFieldConfig prismaClientPath?: string prismaSchemaPath?: string diff --git a/tests/cli-tests/prisma.test.ts.2 b/tests/cli-tests/prisma.test.ts.2 deleted file mode 100644 index 75dc2e5ea79..00000000000 --- a/tests/cli-tests/prisma.test.ts.2 +++ /dev/null @@ -1,37 +0,0 @@ -import { - basicKeystoneConfig, - cliBinPath, - schemas, - spawnCommand, - symlinkKeystoneDeps, - testdir -} from './utils' - -// testing erroring when the schemas are not up to date is in artifacts.test.ts - -test('keystone prisma exits with the same code as the prisma child process exits with', async () => { - const cwd = await testdir({ - ...symlinkKeystoneDeps, - ...schemas, - 'keystone.js': basicKeystoneConfig, - }) - - const output = await spawnCommand(cwd, ['prisma', 'bad-thing']) - expect(result.all!.replace(/[^ -~\n]/g, '?').replace(/ \n/g, '\n')).toMatchSnapshot() - expect(result.exitCode).toBe(1) -}) - -test('keystone prisma uses the db url in the keystone config', async () => { - const tmp = await testdir({ - ...symlinkKeystoneDeps, - ...schemas, - 'keystone.js': basicKeystoneConfig, - }) - const result = await execa('node', [cliBinPath, 'prisma', 'migrate', 'status'], { - reject: false, - all: true, - cwd: tmp, - }) - expect(result.all!.replace(/[^ -~\n]/g, '?').replace(/ \n/g, '\n')).toMatchSnapshot() - expect(result.exitCode).toBe(1) -})