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:
@@ -45,8 +45,7 @@ export async function createVersion<T extends TypeWithID>(
|
||||
|
||||
const table = this.tables[tableName]
|
||||
|
||||
const relationshipsTable =
|
||||
this.tables[`_${defaultTableName}${this.versionsSuffix}${this.relationshipsSuffix}`]
|
||||
const relationshipsTable = this.tables[`${tableName}${this.relationshipsSuffix}`]
|
||||
|
||||
if (collection.versions.drafts) {
|
||||
await db.execute(sql`
|
||||
|
||||
@@ -157,7 +157,9 @@ export default buildConfigWithDefaults({
|
||||
],
|
||||
},
|
||||
],
|
||||
versions: true,
|
||||
versions: {
|
||||
drafts: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
globals: [
|
||||
|
||||
Reference in New Issue
Block a user