mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-10 07:07:21 +00:00
Merge pull request #400 from SyncrowIOT/revert-398-fix-log-duplication-issue
Revert "Refactor DeviceStatusLogEntity: update unique constraint and primary …"
This commit is contained in:
@ -1,16 +1,16 @@
|
||||
import { SourceType } from '@app/common/constants/source-type.enum';
|
||||
import { Entity, Column, Unique, PrimaryGeneratedColumn } from 'typeorm';
|
||||
import { Entity, Column, PrimaryColumn, Unique } from 'typeorm';
|
||||
|
||||
@Entity('device-status-log')
|
||||
@Unique('device_event_time_unique', ['deviceId', 'eventTime'])
|
||||
@Unique('event_time_idx', ['eventTime'])
|
||||
export class DeviceStatusLogEntity {
|
||||
@PrimaryGeneratedColumn()
|
||||
@Column({ type: 'int', generated: true, unsigned: true })
|
||||
id: number;
|
||||
|
||||
@Column({ type: 'text' })
|
||||
eventId: string;
|
||||
|
||||
@Column({ type: 'timestamptz' })
|
||||
@PrimaryColumn({ type: 'timestamptz' })
|
||||
eventTime: Date;
|
||||
|
||||
@Column({
|
||||
|
Reference in New Issue
Block a user