From 050fb9f4509fab9aba6788e14ca6acf0321f2279 Mon Sep 17 00:00:00 2001 From: Benjamin Ramet Date: Wed, 20 Nov 2024 08:58:21 +0100 Subject: [PATCH] Added default value for startingOnField in phaseHistory entity --- server/entities/phaseHistory.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/server/entities/phaseHistory.ts b/server/entities/phaseHistory.ts index b4d9dd10b..6ac23dc4d 100644 --- a/server/entities/phaseHistory.ts +++ b/server/entities/phaseHistory.ts @@ -17,9 +17,17 @@ export class PhaseHistory { }) phase: VillagePhase; - @CreateDateColumn() + @CreateDateColumn({ + type: 'datetime', + precision: 6, + default: () => 'CURRENT_TIMESTAMP(6)', + }) public startingOn: Date; - @DeleteDateColumn() + @DeleteDateColumn({ + type: 'datetime', + precision: 6, + nullable: true, + }) public endingOn: Date; }