From cf87871fbd5bd1ba0fb85861bef791e89fa72eb8 Mon Sep 17 00:00:00 2001 From: Sasha <64744993+r1tsuu@users.noreply.github.com> Date: Tue, 24 Jun 2025 22:07:17 +0300 Subject: [PATCH] test: fix `database/int.spec.ts` with postgres custom schema (#12922) The test was failing because in case you have a custom schema, you need to use `payload.db.pgSchema.table` instead of `pgTable` to define a table --- test/database/int.spec.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/database/int.spec.ts b/test/database/int.spec.ts index 00c59a1a36..4ea7278324 100644 --- a/test/database/int.spec.ts +++ b/test/database/int.spec.ts @@ -1744,12 +1744,14 @@ describe('database', () => { // eslint-disable-next-line jest/no-conditional-in-test if (payload.db.name.includes('postgres')) { - added_table_before = drizzlePg.pgTable('added_table_before', { + // eslint-disable-next-line jest/no-conditional-in-test + const t = (payload.db.pgSchema?.table ?? drizzlePg.pgTable) as typeof drizzlePg.pgTable + added_table_before = t('added_table_before', { id: drizzlePg.serial('id').primaryKey(), text: drizzlePg.text('text'), }) - added_table_after = drizzlePg.pgTable('added_table_after', { + added_table_after = t('added_table_after', { id: drizzlePg.serial('id').primaryKey(), text: drizzlePg.text('text'), })