mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-24 08:07:55 +00:00
added project space model relation
This commit is contained in:
@@ -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[];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user