added project space model relation

This commit is contained in:
hannathkadher
2024-12-10 17:33:50 +04:00
parent 3ee3ff1fc3
commit dc00fdc554
2 changed files with 22 additions and 2 deletions
@@ -2,6 +2,7 @@ import { Entity, Column, Unique, OneToMany } from 'typeorm';
import { AbstractEntity } from '../../abstract/entities/abstract.entity';
import { ProjectDto } from '../dtos';
import { CommunityEntity } from '../../community/entities';
import { SpaceModelEntity } from '../../space-model';
@Entity({ name: 'project' })
@Unique(['name'])
@@ -20,7 +21,10 @@ export class ProjectEntity extends AbstractEntity<ProjectDto> {
@Column({ length: 255, nullable: true })
description: string;
@OneToMany(() => SpaceModelEntity, (spaceModel) => spaceModel.project)
public spaceModels: SpaceModelEntity[];
@OneToMany(() => CommunityEntity, (community) => community.project)
communities: CommunityEntity[];