mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-17 03:05:13 +00:00
changed device log table
This commit is contained in:
@ -1,26 +1,43 @@
|
||||
import { SourceType } from '@app/common/constants/source-type.enum';
|
||||
import { Entity, Column, PrimaryColumn, Index } from 'typeorm';
|
||||
|
||||
@Entity('device-status-log')
|
||||
@Index('logTime_idx', ['logTime'])
|
||||
@Index('logTime_idx', ['eventTime'])
|
||||
export class DeviceStatusLogEntity {
|
||||
@PrimaryColumn()
|
||||
id: number;
|
||||
|
||||
@Column({ type: 'text' })
|
||||
eventId: string;
|
||||
|
||||
@PrimaryColumn({ type: 'timestamptz' })
|
||||
logTime: Date;
|
||||
eventTime: Date;
|
||||
|
||||
@Column({
|
||||
type: 'enum',
|
||||
enum: SourceType,
|
||||
default: SourceType.Device,
|
||||
})
|
||||
eventFrom: SourceType;
|
||||
|
||||
@Column({ type: 'text' })
|
||||
deviceUuid: string;
|
||||
deviceId: string;
|
||||
|
||||
@Column({ type: 'text' })
|
||||
deviceTuyaUuid: string;
|
||||
deviceTuyaId: string;
|
||||
|
||||
@Column({ type: 'text' })
|
||||
productUuid: string;
|
||||
productId: string;
|
||||
|
||||
@Column({ type: 'text' })
|
||||
productType: string;
|
||||
code: any;
|
||||
|
||||
@Column({ type: 'text' })
|
||||
value: any;
|
||||
|
||||
@Column({ type: 'jsonb' })
|
||||
status: any; // JSON array of status codes and values
|
||||
log: any;
|
||||
|
||||
@Column({ type: 'timestamptz', default: new Date() })
|
||||
ingestionTime: Date;
|
||||
}
|
||||
|
Reference in New Issue
Block a user