From d9f9c0cd21dca96b8886e02d1540cbfb413e4b59 Mon Sep 17 00:00:00 2001 From: Marc Roig Date: Wed, 13 Mar 2024 22:21:20 +0100 Subject: [PATCH] fix: correctly set new date (#19766) --- packages/core/core/src/migrations/draft-publish.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/core/core/src/migrations/draft-publish.ts b/packages/core/core/src/migrations/draft-publish.ts index 3194bcd853..9c8fff393d 100644 --- a/packages/core/core/src/migrations/draft-publish.ts +++ b/packages/core/core/src/migrations/draft-publish.ts @@ -68,11 +68,8 @@ const enableDraftAndPublish = async ({ oldContentTypes, contentTypes }: Input) = return qb.raw('NULL as published_at'); } - // TODO: Find a way to insert a date using the correct format - // Before: 1710240975246 - // With qb.fn.now(): 2021-10-24 09:52:46 if (att === 'updated_at') { - return qb.raw(`?? as updated_at`, [qb.fn.now()]); + return qb.raw(`? as updated_at`, [new Date()]); } return att;