From f9d2186488806adde9a903aa8455d2f290d3111d Mon Sep 17 00:00:00 2001 From: c22063583 <WHITEf6@cardiff.ac.uk> Date: Fri, 21 Apr 2023 10:45:13 +0100 Subject: [PATCH] test --- createdb.sql | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/createdb.sql b/createdb.sql index f87eae7..677a6e4 100644 --- a/createdb.sql +++ b/createdb.sql @@ -353,7 +353,7 @@ BEGIN END$$ DELIMITER ; -drop procedure if exists addToGroup; +drop procedure if exists `addToGroup`; delimiter $$ CREATE PROCEDURE addToGroup( IN grapeID varchar(40)) @@ -374,7 +374,7 @@ select count(distinct volunteerID) *(SELECT ageGroup from Sessions where groupID set toad = @maxstu - @currentStu; -- toad reprisents how many students the program should add off the WaitList -- the next loop adds a student to the group from the waitlist equal - -- to the amount of + -- to the amount of spaces available if toad is not null and toad >0 then adding_loop : LOOP SET x=x+1; @@ -391,6 +391,10 @@ select count(distinct volunteerID) *(SELECT ageGroup from Sessions where groupID END IF; END LOOP adding_loop; end if; + select * from WaitList + -- you should see that a number of students application should be successful + -- (if theres space) by dateremoved being null is they still are waiting or + -- todays date if they got added END$$ DELIMITER ; @@ -424,7 +428,25 @@ BEGIN END$$ DELIMITER ; +-- under article 17 of the UK gdpr individuals +-- have the right to have personal data erased +-- next 3 functions handle deleting said data +drop procedure if exists EraseParent; +delimiter $$ +CREATE PROCEDURE EraseParent( + IN email varchar(320), + IN passw varchar(70)) +-- removes children as well +-- we need emergency contact details in case of emergency +-- we are not a financial institution so we don't have a legal requirement + +BEGIN + Delete from parents where ParentsID=md5(concat(email,passw)); + Delete from badgeawarded where awardedto in() + Delete from Students where parentsID=md5(concat(email,passw)); +END$$ +DELIMITER ; drop procedure if exists updateSG; -- GitLab