'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. } };