Add missing migration

This commit is contained in:
Chris Veleris 2025-07-22 10:41:37 +03:00
parent 461b681983
commit 84c29f7a12

View file

@ -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');
},
};