mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-14 18:05:48 +00:00
fix relation tags issue
This commit is contained in:
@ -6,7 +6,6 @@ import {
|
||||
Unique,
|
||||
Index,
|
||||
JoinColumn,
|
||||
JoinTable,
|
||||
} from 'typeorm';
|
||||
import { AbstractEntity } from '../../abstract/entities/abstract.entity';
|
||||
import { DeviceDto, DeviceUserPermissionDto } from '../dtos/device.dto';
|
||||
@ -77,9 +76,8 @@ export class DeviceEntity extends AbstractEntity<DeviceDto> {
|
||||
@OneToMany(() => SceneDeviceEntity, (sceneDevice) => sceneDevice.device, {})
|
||||
sceneDevices: SceneDeviceEntity[];
|
||||
|
||||
|
||||
@OneToMany(() => NewTagEntity, (tag) => tag.devices)
|
||||
@JoinTable({ name: 'device_tags' })
|
||||
// @JoinTable({ name: 'device_tags' })
|
||||
public tag: NewTagEntity[];
|
||||
|
||||
constructor(partial: Partial<DeviceEntity>) {
|
||||
|
@ -1,11 +1,4 @@
|
||||
import {
|
||||
Entity,
|
||||
Column,
|
||||
ManyToOne,
|
||||
Unique,
|
||||
ManyToMany,
|
||||
OneToMany,
|
||||
} from 'typeorm';
|
||||
import { Entity, Column, ManyToOne, Unique, ManyToMany } from 'typeorm';
|
||||
import { ProductEntity } from '../../product/entities';
|
||||
import { ProjectEntity } from '../../project/entities';
|
||||
import { AbstractEntity } from '../../abstract/entities/abstract.entity';
|
||||
@ -55,7 +48,7 @@ export class NewTagEntity extends AbstractEntity<NewTagDto> {
|
||||
)
|
||||
public subspaceModelAllocations: SubspaceModelProductAllocationEntity[];
|
||||
|
||||
@OneToMany(() => DeviceEntity, (device) => device.tag)
|
||||
@ManyToOne(() => DeviceEntity, (device) => device.tag)
|
||||
public devices: DeviceEntity[];
|
||||
|
||||
constructor(partial: Partial<NewTagEntity>) {
|
||||
|
Reference in New Issue
Block a user