feat(vocab): add hard status management for SRS items and update related logic
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
'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;
|
||||
`);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user