fieldmetadatatype + featurelfag creation (#13021)
Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -38,12 +38,17 @@ export class EntitySchemaColumnFactory {
|
||||
for (const fieldMetadata of fieldMetadataCollection) {
|
||||
const key = fieldMetadata.name;
|
||||
|
||||
if (
|
||||
const isRelation =
|
||||
isFieldMetadataInterfaceOfType(
|
||||
fieldMetadata,
|
||||
FieldMetadataType.RELATION,
|
||||
)
|
||||
) {
|
||||
) ||
|
||||
isFieldMetadataInterfaceOfType(
|
||||
fieldMetadata,
|
||||
FieldMetadataType.MORPH_RELATION,
|
||||
);
|
||||
|
||||
if (isRelation) {
|
||||
const isManyToOneRelation =
|
||||
fieldMetadata.settings?.relationType === RelationType.MANY_TO_ONE;
|
||||
const joinColumnName = fieldMetadata.settings?.joinColumnName;
|
||||
|
||||
@ -27,12 +27,17 @@ export class EntitySchemaRelationFactory {
|
||||
);
|
||||
|
||||
for (const fieldMetadata of fieldMetadataCollection) {
|
||||
if (
|
||||
!isFieldMetadataInterfaceOfType(
|
||||
const isRelation =
|
||||
isFieldMetadataInterfaceOfType(
|
||||
fieldMetadata,
|
||||
FieldMetadataType.RELATION,
|
||||
)
|
||||
) {
|
||||
) ||
|
||||
isFieldMetadataInterfaceOfType(
|
||||
fieldMetadata,
|
||||
FieldMetadataType.MORPH_RELATION,
|
||||
);
|
||||
|
||||
if (!isRelation) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@ -18,7 +18,9 @@ interface RelationDetails {
|
||||
}
|
||||
|
||||
export async function determineSchemaRelationDetails(
|
||||
fieldMetadata: FieldMetadataInterface<FieldMetadataType.RELATION>,
|
||||
fieldMetadata: FieldMetadataInterface<
|
||||
FieldMetadataType.RELATION | FieldMetadataType.MORPH_RELATION
|
||||
>,
|
||||
objectMetadataMaps: ObjectMetadataMaps,
|
||||
): Promise<RelationDetails> {
|
||||
if (!fieldMetadata.settings) {
|
||||
|
||||
Reference in New Issue
Block a user