tududi/backend/migrations/20251227000001-remove-today-column.js
Chris e73c354e7e
Fix bug 733 (#735)
* Refactor today

* fixup! Refactor today

* fixup! fixup! Refactor today
2025-12-27 21:00:52 +02:00

30 lines
802 B
JavaScript

'use strict';
const {
safeRemoveColumn,
safeAddColumns,
} = require('../utils/migration-utils');
/**
* Migration to remove the deprecated 'today' column from tasks table.
* The 'today' field is no longer used - task visibility in the today view
* is now determined by status (in_progress, planned, waiting).
*
* @type {import('sequelize-cli').Migration}
*/
module.exports = {
async up(queryInterface, Sequelize) {
await safeRemoveColumn(queryInterface, 'tasks', 'today');
},
async down(queryInterface, Sequelize) {
await safeAddColumns(queryInterface, 'tasks', [
{
name: 'today',
type: Sequelize.BOOLEAN,
allowNull: false,
defaultValue: false,
},
]);
},
};