From e4d024cd0d2a754cbb94ba1f68d7e9259b5c2a96 Mon Sep 17 00:00:00 2001 From: James Date: Tue, 23 Apr 2024 12:43:25 -0400 Subject: [PATCH] chore: properly destroys db in postgres --- packages/db-postgres/src/destroy.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/db-postgres/src/destroy.ts b/packages/db-postgres/src/destroy.ts index 3ec3a4bcef..7fd89095a0 100644 --- a/packages/db-postgres/src/destroy.ts +++ b/packages/db-postgres/src/destroy.ts @@ -2,13 +2,13 @@ import type { Destroy } from 'payload/database' import type { PostgresAdapter } from './types.js' -import { pushDevSchema } from './utilities/pushDevSchema.js' - +// eslint-disable-next-line @typescript-eslint/require-await export const destroy: Destroy = async function destroy(this: PostgresAdapter) { - if (process.env.NODE_ENV !== 'production') { - await pushDevSchema(this) - } else { - // TODO: this hangs test suite for some reason - // await this.pool.end() - } + this.enums = {} + this.schema = {} + this.tables = {} + this.relations = {} + this.blockTableNames = {} + this.fieldConstraints = {} + this.drizzle = undefined }