Skip to content

Commit

Permalink
fix(db-postgres): row table names were not being built properly - v2 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrikKozak committed Apr 22, 2024
1 parent fc8b835 commit 9152a23
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/db-postgres/src/schema/traverseFields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ export const traverseFields = ({
indexes,
localesColumns,
localesIndexes,
newTableName: parentTableName,
newTableName,
parentTableName,
relationsToBuild,
relationships,
Expand Down
15 changes: 15 additions & 0 deletions test/fields/collections/Tabs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,21 @@ const TabsFields: CollectionConfig = {
type: 'text',
defaultValue: namedTabDefaultValue,
},
{
type: 'row',
fields: [
{
name: 'arrayInRow',
type: 'array',
fields: [
{
name: 'textInArrayInRow',
type: 'text',
},
],
},
],
},
],
},
{
Expand Down
5 changes: 5 additions & 0 deletions test/fields/collections/Tabs/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ export const tabsDoc: Partial<TabsField> = {
},
],
text: namedTabText,
arrayInRow: [
{
text: "Hello, I'm some text in an array in a row",
},
],
},
localizedTab: {
text: localizedTextValue,
Expand Down
4 changes: 4 additions & 0 deletions test/fields/payload-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1083,6 +1083,10 @@ export interface TabsField {
}[]
text?: string | null
defaultValue?: string | null
arrayInRow?: {
text: string
id?: string | null
}[]
}
namedTabWithDefaultValue: {
defaultValue?: string | null
Expand Down

0 comments on commit 9152a23

Please sign in to comment.