25 lines
702 B
JavaScript
25 lines
702 B
JavaScript
'use strict';
|
|
|
|
module.exports = {
|
|
async up(queryInterface) {
|
|
await queryInterface.sequelize.query(`
|
|
ALTER TABLE community.vocab_srs_item
|
|
ADD COLUMN IF NOT EXISTS is_hard BOOLEAN NOT NULL DEFAULT FALSE;
|
|
`);
|
|
await queryInterface.sequelize.query(`
|
|
CREATE INDEX IF NOT EXISTS idx_vocab_srs_item_hard
|
|
ON community.vocab_srs_item (user_id, course_id, is_hard, next_due_at);
|
|
`);
|
|
},
|
|
|
|
async down(queryInterface) {
|
|
await queryInterface.sequelize.query(`
|
|
DROP INDEX IF EXISTS community.idx_vocab_srs_item_hard;
|
|
`);
|
|
await queryInterface.sequelize.query(`
|
|
ALTER TABLE community.vocab_srs_item
|
|
DROP COLUMN IF EXISTS is_hard;
|
|
`);
|
|
}
|
|
};
|