Files
public-pool/src/ORM/client-statistics/client-statistics.entity.ts
T
2023-08-11 22:35:58 -04:00

36 lines
737 B
TypeScript

import { Column, Entity, Index, PrimaryColumn } from 'typeorm';
import { TrackedEntity } from '../utils/TrackedEntity.entity';
@Entity()
//Index for the heartbeat update
@Index(["address", "clientName", "sessionId", "time"])
export class ClientStatisticsEntity extends TrackedEntity {
@PrimaryColumn({ length: 64, type: 'varchar' })
submissionHash: string;
@Column({ length: 62, type: 'varchar' })
address: string;
@Column()
clientName: string;
@Column({ length: 8, type: 'varchar' })
sessionId: string;
@Index()
@Column({ type: 'integer' })
time: number;
@Column({ type: 'real' })
shares: number;
@Column({ default: 0, type: 'integer' })
acceptedCount: number;
}