mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 18:54:54 +00:00
added the relation between models and space
This commit is contained in:
@ -15,6 +15,7 @@ import { SubspaceEntity } from './subspace.entity';
|
||||
import { SpaceLinkEntity } from './space-link.entity';
|
||||
import { SpaceProductEntity } from './space-product.entity';
|
||||
import { SceneEntity } from '../../scene/entities';
|
||||
import { SpaceModelEntity } from '../../space-model';
|
||||
|
||||
@Entity({ name: 'space' })
|
||||
@Unique(['invitationCode'])
|
||||
@ -98,6 +99,10 @@ export class SpaceEntity extends AbstractEntity<SpaceDto> {
|
||||
@OneToMany(() => SceneEntity, (scene) => scene.space)
|
||||
scenes: SceneEntity[];
|
||||
|
||||
@ManyToOne(() => SpaceModelEntity, { nullable: true })
|
||||
@JoinColumn({ name: 'space_model_uuid' })
|
||||
spaceModel?: SpaceModelEntity;
|
||||
|
||||
constructor(partial: Partial<SpaceEntity>) {
|
||||
super();
|
||||
Object.assign(this, partial);
|
||||
|
||||
Reference in New Issue
Block a user