added timeseries

This commit is contained in:
unknown
2024-10-20 16:46:44 +03:00
parent 1f6072c292
commit 07ac955eb0
9 changed files with 62 additions and 2 deletions

View File

@ -0,0 +1,26 @@
import { Entity, Column, PrimaryColumn, Index } from 'typeorm';
@Entity('device-status-log')
@Index('logTime_idx', ['logTime'])
export class DeviceStatusLogEntity {
@PrimaryColumn()
id: number;
@PrimaryColumn({ type: 'timestamptz' })
logTime: Date;
@Column({ type: 'text' })
deviceUuid: string;
@Column({ type: 'text' })
deviceTuyaUuid: string;
@Column({ type: 'text' })
productUuid: string;
@Column({ type: 'text' })
productType: string;
@Column({ type: 'jsonb' })
status: any; // JSON array of status codes and values
}