chore: properly destroys db in postgres
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user