From 94a246a1aa008692c19803afddcfac039a890f34 Mon Sep 17 00:00:00 2001 From: L4168 <L4168@student.jamk.fi> Date: Thu, 18 Jul 2019 14:00:42 +0300 Subject: [PATCH] convert score timestamps to unix --- src/score/score.entity.ts | 2 +- src/score/score.service.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/score/score.entity.ts b/src/score/score.entity.ts index 6ca9ab7..1047f90 100644 --- a/src/score/score.entity.ts +++ b/src/score/score.entity.ts @@ -12,7 +12,7 @@ import { FactionEntity } from '../faction/faction.entity'; export class ScoreEntity { @PrimaryGeneratedColumn('uuid') scoreId: string; @Column({ type: 'float' }) score: number; - @CreateDateColumn({ type: 'timestamp' }) scoreTimeStamp: Timestamp; + @Column({ type: 'float' }) scoreTimeStamp: number; @ManyToOne(type => FactionEntity, factionName => factionName.factionId, { onDelete: 'CASCADE', diff --git a/src/score/score.service.ts b/src/score/score.service.ts index 90716c4..a0ff983 100644 --- a/src/score/score.service.ts +++ b/src/score/score.service.ts @@ -44,6 +44,7 @@ export class ScoreService { } // add the score for Faction const newScore = await this.scoreRepository.create(scoreData); + newScore.scoreTimeStamp = Date.now(); await this.scoreRepository.insert(newScore); return { message: 'Score updated!', -- GitLab