mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
18 lines
854 B
JavaScript
18 lines
854 B
JavaScript
'use strict';
|
|
|
|
// quiz_attempts.started_at and quiz_attempts.status were added via raw SQL
|
|
// during an earlier development session. The assessment_sessions table now owns
|
|
// session lifecycle; quiz_attempts are always-graded completed records only.
|
|
module.exports = {
|
|
async up(queryInterface, Sequelize) {
|
|
const tableDesc = await queryInterface.describeTable('quiz_attempts');
|
|
if (tableDesc.started_at) await queryInterface.removeColumn('quiz_attempts', 'started_at');
|
|
if (tableDesc.status) await queryInterface.removeColumn('quiz_attempts', 'status');
|
|
},
|
|
|
|
async down(queryInterface, Sequelize) {
|
|
await queryInterface.addColumn('quiz_attempts', 'started_at', { type: Sequelize.DATE, allowNull: true });
|
|
await queryInterface.addColumn('quiz_attempts', 'status', { type: Sequelize.STRING(20), allowNull: true });
|
|
},
|
|
};
|