From 71efc848e66715ec6eb76ed60d4c34c2a686fbd4 Mon Sep 17 00:00:00 2001 From: Viktor Riabkov Date: Mon, 23 Dec 2024 21:27:29 +0700 Subject: [PATCH] Fix migration --- .../20241208081622-add-status-to-userChallenge.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/database/migrations/20241208081622-add-status-to-userChallenge.js b/src/database/migrations/20241208081622-add-status-to-userChallenge.js index 3955ba0..3e62e2e 100644 --- a/src/database/migrations/20241208081622-add-status-to-userChallenge.js +++ b/src/database/migrations/20241208081622-add-status-to-userChallenge.js @@ -13,11 +13,15 @@ module.exports = { }); const currentDate = new Date(); - const currentMonth = currentDate.getMonth(); + const currentMonth = currentDate.getMonth() + 1; const currentYear = currentDate.getFullYear(); + console.log(currentMonth); + const formattedCurrentMonth = ('0' + currentMonth).slice(-2); + console.log(formattedCurrentMonth); + await queryInterface.bulkUpdate( 'userChallenge', { status: 'ACTIVE' },