Desktop UI updates

This commit is contained in:
ivan-pelly
2026-02-28 09:51:53 -08:00
parent b6b058f05e
commit 592c7324a1
39 changed files with 907 additions and 363 deletions
@@ -1,6 +1,8 @@
DELIMITER ;;
CREATE DEFINER=`root`@`%` PROCEDURE `sp_Student_Delete`(IN p_id_student CHAR(36))
BEGIN
DELETE FROM user_student
WHERE id_student = p_id_student;
DELETE FROM student
WHERE id_student = p_id_student;
SELECT ROW_COUNT() AS rows_affected;
@@ -4,7 +4,6 @@ BEGIN
SELECT
id_student,
id_program,
id_user,
identifier,
program_year,
enrollment_date,
@@ -4,7 +4,6 @@ BEGIN
SELECT
id_student,
id_program,
id_user,
identifier,
program_year,
enrollment_date,
@@ -1,19 +0,0 @@
DELIMITER ;;
CREATE DEFINER=`root`@`%` PROCEDURE `sp_Student_GetByProgram`(
IN p_id_program CHAR(36)
)
BEGIN
SELECT
id_student,
id_program,
id_user,
identifier,
program_year,
enrollment_date,
expected_grad,
created_at
FROM student
WHERE id_program = p_id_program
ORDER BY id_student;
END;;
DELIMITER ;
@@ -1,21 +0,0 @@
DELIMITER ;;
CREATE DEFINER=`root`@`%` PROCEDURE `sp_Student_GetByUserAndProgram`(
IN p_id_user CHAR(36),
IN p_id_program CHAR(36)
)
BEGIN
SELECT
s.id_student,
s.id_program,
s.id_user,
s.identifier,
s.program_year,
s.enrollment_date,
s.expected_grad,
s.created_at
FROM student s
WHERE s.id_user = p_id_user
AND s.id_program = p_id_program
ORDER BY s.id_student;
END;;
DELIMITER ;
@@ -0,0 +1,30 @@
DELIMITER ;;
CREATE DEFINER=`root`@`%` PROCEDURE `sp_Student_GetWithAssignments`(
IN p_id_program CHAR(36),
IN p_id_user CHAR(36)
)
BEGIN
-- Result set 1: All students in the program
SELECT
s.id_student,
s.id_program,
s.identifier,
s.program_year,
s.enrollment_date,
s.expected_grad,
s.created_at
FROM student s
WHERE s.id_program = p_id_program
ORDER BY s.id_student;
-- Result set 2: user_student assignments for the requesting user in this program
SELECT
us.id_user_student,
us.id_user,
us.id_student,
us.is_primary
FROM user_student us
INNER JOIN student s ON s.id_student = us.id_student
WHERE us.id_user = p_id_user
AND s.id_program = p_id_program;
END;;
DELIMITER ;
+2 -3
View File
@@ -13,7 +13,6 @@ BEGIN
(
id_student,
id_program,
id_user,
identifier,
program_year,
enrollment_date,
@@ -24,17 +23,17 @@ BEGIN
(
p_id_student,
p_id_program,
p_id_user,
p_identifier,
p_program_year,
p_enrollment_date,
p_expected_grad,
UTC_TIMESTAMP()
);
INSERT INTO user_student (id_user_student, id_user, id_student, is_primary)
VALUES (UUID(), p_id_user, p_id_student, 1);
SELECT
id_student,
id_program,
id_user,
identifier,
program_year,
enrollment_date,
+1 -4
View File
@@ -1,7 +1,6 @@
CREATE TABLE `student` (
`id_student` char(36) NOT NULL,
`id_program` char(36) DEFAULT NULL,
`id_user` char(36) DEFAULT NULL,
`identifier` varchar(50) DEFAULT NULL,
`program_year` int DEFAULT NULL,
`enrollment_date` date DEFAULT NULL,
@@ -9,7 +8,5 @@ CREATE TABLE `student` (
`created_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_student`),
KEY `student_ibfk_1` (`id_program`),
KEY `student_ibfk_2` (`id_user`),
CONSTRAINT `student_ibfk_1` FOREIGN KEY (`id_program`) REFERENCES `program` (`id_program`),
CONSTRAINT `student_ibfk_2` FOREIGN KEY (`id_user`) REFERENCES `user` (`id_user`)
CONSTRAINT `student_ibfk_1` FOREIGN KEY (`id_program`) REFERENCES `program` (`id_program`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;