fix(vocab): remove obsolete Bisaya SRS cards
All checks were successful
Deploy to production / deploy (push) Successful in 2m53s
All checks were successful
Deploy to production / deploy (push) Successful in 2m53s
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Removes obsolete or incorrectly split Bisaya SRS cards that were created by
|
||||
* older course imports. The current course content already uses the intended
|
||||
* Spanish-derived tens and complete repair phrases.
|
||||
*/
|
||||
module.exports = {
|
||||
async up(queryInterface) {
|
||||
await queryInterface.sequelize.query(`
|
||||
DELETE FROM community.vocab_srs_item
|
||||
WHERE course_id = 1
|
||||
AND (
|
||||
lower(learning) ~ '(kawhaan|katloan|kalim[- ]?an|kanum[- ]?an|kap[- ]?atan|kapitoan|kawaloan|kasiyaman)'
|
||||
OR lower(reference) ~ '(kawhaan|katloan|kalim[- ]?an|kanum[- ]?an|kap[- ]?atan|kapitoan|kawaloan|kasiyaman)'
|
||||
);
|
||||
|
||||
DELETE FROM community.vocab_srs_item
|
||||
WHERE course_id = 1
|
||||
AND (
|
||||
(
|
||||
regexp_replace(lower(learning), '[[:punct:][:space:]]', '', 'g') = 'bitte'
|
||||
AND regexp_replace(lower(reference), '[[:punct:][:space:]]', '', 'g') = 'palihug'
|
||||
)
|
||||
OR (
|
||||
lower(learning) = 'bitte wiederholen'
|
||||
AND lower(reference) IN ('palihug', 'palihug ka mubalik?')
|
||||
)
|
||||
);
|
||||
`);
|
||||
},
|
||||
|
||||
async down() {
|
||||
// Deleted legacy cards cannot be reconstructed reliably.
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user