Fix student grade registration: set grade_10 as default, add auto-heal for legacy tawjihi_2008, add student grade selector and update-grade API
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
-- ==============================================================================
|
||||
-- Migration: Fix student grade defaults to Grade 10 instead of Tawjihi 2008
|
||||
-- ==============================================================================
|
||||
|
||||
ALTER TABLE `students` ALTER COLUMN `grade_level` SET DEFAULT 'grade_10';
|
||||
ALTER TABLE `school_rosters` ALTER COLUMN `grade_level` SET DEFAULT 'grade_10';
|
||||
|
||||
-- Repair existing students who were accidentally defaulted to tawjihi_2008 / grade_12
|
||||
UPDATE `students` SET `grade_level` = 'grade_10' WHERE `grade_level` IN ('tawjihi_2008', 'grade_12');
|
||||
UPDATE `school_rosters` SET `grade_level` = 'grade_10' WHERE `grade_level` IN ('tawjihi_2008', 'grade_12');
|
||||
Reference in New Issue
Block a user