2026-04-12-1
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { Entity, Column, PrimaryColumn, Index, CreateDateColumn } from 'typeorm';
|
||||
|
||||
@Entity('road_speed_profiles')
|
||||
@Index(['segmentId', 'hourOfDay', 'dayOfWeek'], { unique: true })
|
||||
export class RoadSpeedProfile {
|
||||
@PrimaryColumn()
|
||||
segmentId: string;
|
||||
|
||||
@PrimaryColumn()
|
||||
hourOfDay: number; // 0-23
|
||||
|
||||
@PrimaryColumn()
|
||||
dayOfWeek: number; // 0-6 (0 = Sunday)
|
||||
|
||||
@Column('float', { default: 0 })
|
||||
averageSpeed: number;
|
||||
|
||||
@Column('int', { default: 0 })
|
||||
sampleCount: number;
|
||||
|
||||
@CreateDateColumn()
|
||||
lastUpdated: Date;
|
||||
}
|
||||
Reference in New Issue
Block a user