feat: twenty orm sync (#5266)
This PR is updating all object metadata entities with the new decorators, and deleting the old ones. This way we can use the new TwentyORM with all the standard objects. --------- Co-authored-by: Weiko <corentin@twenty.com>
This commit is contained in:
@ -15,10 +15,10 @@ export class EntitySchemaFactory {
|
||||
) {}
|
||||
|
||||
create<T>(target: Type<T>): EntitySchema {
|
||||
const objectMetadataArgs = metadataArgsStorage.filterObjects(target);
|
||||
const entityMetadataArgs = metadataArgsStorage.filterEntities(target);
|
||||
|
||||
if (!objectMetadataArgs) {
|
||||
throw new Error('Object metadata args are missing on this target');
|
||||
if (!entityMetadataArgs) {
|
||||
throw new Error('Entity metadata args are missing on this target');
|
||||
}
|
||||
|
||||
const fieldMetadataArgsCollection =
|
||||
@ -35,8 +35,8 @@ export class EntitySchemaFactory {
|
||||
);
|
||||
|
||||
const entitySchema = new EntitySchema({
|
||||
name: objectMetadataArgs.nameSingular,
|
||||
tableName: objectMetadataArgs.nameSingular,
|
||||
name: entityMetadataArgs.nameSingular,
|
||||
tableName: entityMetadataArgs.nameSingular,
|
||||
columns,
|
||||
relations,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user