chore: properly destroys db in postgres

This commit is contained in:
James
2024-04-23 12:43:25 -04:00
parent 1005de8295
commit e4d024cd0d

View File

@@ -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
}