Skip to content
Snippets Groups Projects
Commit 2e3439e8 authored by Artem Konenko's avatar Artem Konenko Committed by PavelBegunkov
Browse files

#127 Add refactored procedures & fixes to migrations

parent 65d2276d
Branches
Tags
No related merge requests found
delete from `study_groups` WHERE GradeID in (
select id from grades where Degree not in ('bachelor', 'specialist', 'master')
);
delete from grades where Degree not in ('bachelor', 'specialist', 'master');
-- recalculate CurRate in discipline table
update disciplines
inner join (
select modules.DisciplineID, SUM(submodules.MaxRate) as rate
from submodules
inner join modules on submodules.ModuleID = modules.ID
where submodules.isUsed and (modules.Type = 'regular' or (modules.Type = 'exam' and modules.OrderNum = 1))
group by modules.DisciplineID
) as t on disciplines.ID = t.DisciplineID
set disciplines.CurRate = t.rate;
This diff is collapsed.
This diff is collapsed.
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment