fix(db-postgres): uuid custom db name (#6408)

## Description

Fixes an issue with creating versions when using custom DB names,
`uuid`, and drafts.

---------

Co-authored-by: PatrikKozak <patrik@payloadcms.com>
This commit is contained in:
James Mikrut
2024-05-17 14:11:14 -04:00
committed by GitHub
parent 12c812d379
commit c2571cfdb6
2 changed files with 4 additions and 3 deletions

View File

@@ -45,8 +45,7 @@ export async function createVersion<T extends TypeWithID>(
const table = this.tables[tableName] const table = this.tables[tableName]
const relationshipsTable = const relationshipsTable = this.tables[`${tableName}${this.relationshipsSuffix}`]
this.tables[`_${defaultTableName}${this.versionsSuffix}${this.relationshipsSuffix}`]
if (collection.versions.drafts) { if (collection.versions.drafts) {
await db.execute(sql` await db.execute(sql`

View File

@@ -157,7 +157,9 @@ export default buildConfigWithDefaults({
], ],
}, },
], ],
versions: true, versions: {
drafts: true,
},
}, },
], ],
globals: [ globals: [