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,
|
Unique,
|
||||||
Index,
|
Index,
|
||||||
JoinColumn,
|
JoinColumn,
|
||||||
JoinTable,
|
|
||||||
} from 'typeorm';
|
} from 'typeorm';
|
||||||
import { AbstractEntity } from '../../abstract/entities/abstract.entity';
|
import { AbstractEntity } from '../../abstract/entities/abstract.entity';
|
||||||
import { DeviceDto, DeviceUserPermissionDto } from '../dtos/device.dto';
|
import { DeviceDto, DeviceUserPermissionDto } from '../dtos/device.dto';
|
||||||
@ -77,9 +76,8 @@ export class DeviceEntity extends AbstractEntity<DeviceDto> {
|
|||||||
@OneToMany(() => SceneDeviceEntity, (sceneDevice) => sceneDevice.device, {})
|
@OneToMany(() => SceneDeviceEntity, (sceneDevice) => sceneDevice.device, {})
|
||||||
sceneDevices: SceneDeviceEntity[];
|
sceneDevices: SceneDeviceEntity[];
|
||||||
|
|
||||||
|
|
||||||
@OneToMany(() => NewTagEntity, (tag) => tag.devices)
|
@OneToMany(() => NewTagEntity, (tag) => tag.devices)
|
||||||
@JoinTable({ name: 'device_tags' })
|
// @JoinTable({ name: 'device_tags' })
|
||||||
public tag: NewTagEntity[];
|
public tag: NewTagEntity[];
|
||||||
|
|
||||||
constructor(partial: Partial<DeviceEntity>) {
|
constructor(partial: Partial<DeviceEntity>) {
|
||||||
|
@ -1,11 +1,4 @@
|
|||||||
import {
|
import { Entity, Column, ManyToOne, Unique, ManyToMany } from 'typeorm';
|
||||||
Entity,
|
|
||||||
Column,
|
|
||||||
ManyToOne,
|
|
||||||
Unique,
|
|
||||||
ManyToMany,
|
|
||||||
OneToMany,
|
|
||||||
} from 'typeorm';
|
|
||||||
import { ProductEntity } from '../../product/entities';
|
import { ProductEntity } from '../../product/entities';
|
||||||
import { ProjectEntity } from '../../project/entities';
|
import { ProjectEntity } from '../../project/entities';
|
||||||
import { AbstractEntity } from '../../abstract/entities/abstract.entity';
|
import { AbstractEntity } from '../../abstract/entities/abstract.entity';
|
||||||
@ -55,7 +48,7 @@ export class NewTagEntity extends AbstractEntity<NewTagDto> {
|
|||||||
)
|
)
|
||||||
public subspaceModelAllocations: SubspaceModelProductAllocationEntity[];
|
public subspaceModelAllocations: SubspaceModelProductAllocationEntity[];
|
||||||
|
|
||||||
@OneToMany(() => DeviceEntity, (device) => device.tag)
|
@ManyToOne(() => DeviceEntity, (device) => device.tag)
|
||||||
public devices: DeviceEntity[];
|
public devices: DeviceEntity[];
|
||||||
|
|
||||||
constructor(partial: Partial<NewTagEntity>) {
|
constructor(partial: Partial<NewTagEntity>) {
|
||||||
|
Reference in New Issue
Block a user