'use strict'; // passwordChangedAt was added in 003 for new installs; this migration ensures // it exists on V1 upgrades where 003 ran the addIfMissing path but may have // been using an older column list. module.exports = { async up(queryInterface, Sequelize) { const tableDesc = await queryInterface.describeTable('Users').catch(() => null); if (tableDesc && !tableDesc['passwordChangedAt']) { await queryInterface.addColumn('Users', 'passwordChangedAt', { type: Sequelize.DATE, allowNull: true, }); } }, async down(queryInterface) { await queryInterface.removeColumn('Users', 'passwordChangedAt').catch(() => {}); }, };