Morph relation : migration builder (#13173)
This PR will create the migration to be run for the morph relations - We created a dedicated util to generate the column name and refactored a little the code in order to have less dependencies and a clearer devX (updated the snapshot that changed because of this) - Moved the `createMigrationActions` to its own util as well - Created the `MorphRelationColumnActionFactory` based on the relation one --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -60,7 +60,7 @@ exports[`Field metadata morph relation creation should fail relation MANY_TO_ONE
|
||||
"exceptionEventId": "mocked-exception-id",
|
||||
"userFriendlyMessage": "An error occurred.",
|
||||
},
|
||||
"message": "Object metadata relation target not found for relation creation payload",
|
||||
"message": "Target object metadata does not exist in the object metadata maps",
|
||||
},
|
||||
]
|
||||
`;
|
||||
@ -153,7 +153,7 @@ exports[`Field metadata morph relation creation should fail relation ONE_TO_MANY
|
||||
"exceptionEventId": "mocked-exception-id",
|
||||
"userFriendlyMessage": "An error occurred.",
|
||||
},
|
||||
"message": "Object metadata relation target not found for relation creation payload",
|
||||
"message": "Target object metadata does not exist in the object metadata maps",
|
||||
},
|
||||
]
|
||||
`;
|
||||
|
||||
@ -149,7 +149,7 @@ describe('createOne FieldMetadataService morph relation fields', () => {
|
||||
|
||||
if (isManyToOne) {
|
||||
expect(createdField.settings?.joinColumnName).toBe(
|
||||
'ownerOpportunityForMorphRelationId',
|
||||
'ownerPersonForMorphRelationId',
|
||||
);
|
||||
} else {
|
||||
expect(createdField.settings?.joinColumnName).toBeUndefined();
|
||||
|
||||
Reference in New Issue
Block a user