mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-27 18:24:53 +00:00
added project community relation
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import { Entity, Column, Unique } from 'typeorm';
|
||||
import { Entity, Column, Unique, OneToMany } from 'typeorm';
|
||||
import { AbstractEntity } from '../../abstract/entities/abstract.entity';
|
||||
import { ProjectDto } from '../dtos';
|
||||
import { CommunityEntity } from '../../community/entities';
|
||||
|
||||
@Entity({ name: 'project' })
|
||||
@Unique(['name'])
|
||||
@ -19,6 +20,9 @@ export class ProjectEntity extends AbstractEntity<ProjectDto> {
|
||||
|
||||
@Column({ length: 255, nullable: true })
|
||||
description: string;
|
||||
|
||||
@OneToMany(() => CommunityEntity, (community) => community.project)
|
||||
communities: CommunityEntity[];
|
||||
|
||||
constructor(partial: Partial<ProjectEntity>) {
|
||||
super();
|
||||
|
||||
Reference in New Issue
Block a user