Migrate standard objects (#2439)
* Migrate standard objects * Add migrations * fix relation * fix: register RelationMetadataType enum * fix: correctly fix null relation --------- Co-authored-by: corentin <corentin@twenty.com> Co-authored-by: Jérémy Magrin <jeremy.magrin@gmail.com>
This commit is contained in:
@ -17,7 +17,7 @@ import { RelationMetadataType } from 'src/metadata/relation-metadata/relation-me
|
||||
export class CreateRelationInput {
|
||||
@IsEnum(RelationMetadataType)
|
||||
@IsNotEmpty()
|
||||
@Field()
|
||||
@Field(() => RelationMetadataType)
|
||||
relationType: RelationMetadataType;
|
||||
|
||||
@IsUUID()
|
||||
|
||||
@ -29,7 +29,7 @@ export class RelationMetadataDTO {
|
||||
@IDField(() => ID)
|
||||
id: string;
|
||||
|
||||
@Field()
|
||||
@Field(() => RelationMetadataType)
|
||||
relationType: RelationMetadataType;
|
||||
|
||||
@Field()
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
import { registerEnumType } from '@nestjs/graphql';
|
||||
|
||||
import {
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
@ -20,6 +22,11 @@ export enum RelationMetadataType {
|
||||
MANY_TO_MANY = 'MANY_TO_MANY',
|
||||
}
|
||||
|
||||
registerEnumType(RelationMetadataType, {
|
||||
name: 'RelationMetadataType',
|
||||
description: 'Type of the relation',
|
||||
});
|
||||
|
||||
@Entity('relationMetadata')
|
||||
export class RelationMetadataEntity implements RelationMetadataInterface {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
|
||||
Reference in New Issue
Block a user