diff --git a/packages/plugin-collections/src/models/field.ts b/packages/plugin-collections/src/models/field.ts index 59d6c40c2..30ef18917 100644 --- a/packages/plugin-collections/src/models/field.ts +++ b/packages/plugin-collections/src/models/field.ts @@ -28,7 +28,9 @@ export class FieldModel extends BaseModel { if (['hasOne', 'hasMany', 'belongsTo', 'belongsToMany'].includes(data.type)) { if (!data.name) { data.name = generateFieldName(); - data.target = generateCollectionName(); + if (!data.target) { + data.target = generateCollectionName(); + } } if (!data.target) { data.target = ['hasOne', 'belongsTo'].includes(data.type) ? Utils.pluralize(data.name) : data.name;