tududi/backend/migrations/20250621221841-add-completed-at-to-tasks.js
Antonis Anastasiadis 4878c71618 Lint & format (#159)
Co-authored-by: antanst <>
2025-07-15 10:44:02 +03:00

24 lines
689 B
JavaScript

'use strict';
const { safeAddColumns, safeAddIndex } = require('../utils/migration-utils');
module.exports = {
async up(queryInterface, Sequelize) {
await safeAddColumns(queryInterface, 'tasks', [
{
name: 'completed_at',
definition: {
type: Sequelize.DATE,
allowNull: true,
},
},
]);
await safeAddIndex(queryInterface, 'tasks', ['completed_at']);
},
async down(queryInterface, Sequelize) {
await queryInterface.removeIndex('tasks', ['completed_at']);
await queryInterface.removeColumn('tasks', 'completed_at');
},
};