Fix relationship conflicts

This commit is contained in:
Adria Navarro 2025-04-09 11:01:44 +02:00
parent dfb5c1d717
commit 4e8e725b4b
2 changed files with 7 additions and 2 deletions

@ -1 +1 @@
Subproject commit 42ad279dd750ac977f5ab9778487e722fea973b4
Subproject commit 3d037429b09281ed499d91a39fcacb0dd4e27c74

View File

@ -74,7 +74,12 @@ async function generateTablesDelegate(data: ai.GenerationStructure) {
schema: {
...storedTable.schema,
...table.schema.reduce<TableSchema>((acc, field) => {
acc[field.name] = field
if (field.type === FieldType.LINK) {
const { reverseFieldName, relationshipId, ...rest } = field
acc[field.name] = { ...rest, fieldName: reverseFieldName }
} else {
acc[field.name] = field
}
return acc
}, {}),
},