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 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`
|
||||||
|
|||||||
@@ -157,7 +157,9 @@ export default buildConfigWithDefaults({
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
versions: true,
|
versions: {
|
||||||
|
drafts: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
globals: [
|
globals: [
|
||||||
|
|||||||
Reference in New Issue
Block a user