fix(drizzle): hasMany joins - localized, limit and schema paths (#8633)
Fixes https://github.com/payloadcms/payload/issues/8630 - Fixes `hasMany: true` and `localized: true` on the foreign field - Adds `limit` to the subquery instead of hardcoded `11`. - Adds the schema path `field.on` to the subquery, without this having 2 or more relationship fields to the same collection breaks joins - Properly checks if the field is `hasMany`
This commit is contained in:
@@ -55,6 +55,12 @@ export const Categories: CollectionConfig = {
|
||||
collection: postsSlug,
|
||||
on: 'categories',
|
||||
},
|
||||
{
|
||||
name: 'hasManyPostsLocalized',
|
||||
type: 'join',
|
||||
collection: postsSlug,
|
||||
on: 'categoriesLocalized',
|
||||
},
|
||||
{
|
||||
name: 'group',
|
||||
type: 'group',
|
||||
|
||||
Reference in New Issue
Block a user