From 84c29f7a128e61303df10d0d18c5a9cb2cde55fc Mon Sep 17 00:00:00 2001 From: Chris Veleris Date: Tue, 22 Jul 2025 10:41:37 +0300 Subject: [PATCH] Add missing migration --- ...50722051746-add-today-settings-to-users.js | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 backend/migrations/20250722051746-add-today-settings-to-users.js diff --git a/backend/migrations/20250722051746-add-today-settings-to-users.js b/backend/migrations/20250722051746-add-today-settings-to-users.js new file mode 100644 index 0000000..c7048c6 --- /dev/null +++ b/backend/migrations/20250722051746-add-today-settings-to-users.js @@ -0,0 +1,34 @@ +'use strict'; + +module.exports = { + async up(queryInterface, Sequelize) { + try { + const tableInfo = await queryInterface.describeTable('users'); + + // Check if today_settings column already exists + if (!('today_settings' in tableInfo)) { + await queryInterface.addColumn('users', 'today_settings', { + type: Sequelize.JSON, + allowNull: true, + defaultValue: { + showMetrics: false, + showProductivity: false, + showNextTaskSuggestion: false, + showSuggestions: false, + showDueToday: true, + showCompleted: true, + showProgressBar: true, + showDailyQuote: true, + }, + }); + } + } catch (error) { + console.log('Migration error:', error.message); + throw error; + } + }, + + async down(queryInterface, Sequelize) { + await queryInterface.removeColumn('users', 'today_settings'); + }, +};