This commit is contained in:
ivan-pelly
2026-02-27 18:29:11 -08:00
parent 6de30bd77e
commit b6b058f05e
12 changed files with 32 additions and 26 deletions
@@ -2,6 +2,7 @@ DELIMITER ;;
CREATE DEFINER=`root`@`%` PROCEDURE `sp_RefreshToken_Create`(
IN p_id_refresh_token CHAR(36),
IN p_id_user CHAR(36),
IN p_id_program CHAR(36),
IN p_token_hash VARCHAR(512),
IN p_token_salt VARCHAR(512),
IN p_expires_in_seconds INT,
@@ -13,6 +14,7 @@ BEGIN
(
id_refresh_token,
id_user,
id_program,
token_hash,
token_salt,
expires_at,
@@ -23,6 +25,7 @@ BEGIN
(
p_id_refresh_token,
p_id_user,
p_id_program,
p_token_hash,
p_token_salt,
DATE_ADD(UTC_TIMESTAMP(), INTERVAL p_expires_in_seconds SECOND),
@@ -3,6 +3,7 @@ CREATE DEFINER=`root`@`%` PROCEDURE `sp_RefreshToken_Replace`(
IN p_old_token_id CHAR(36),
IN p_id_refresh_token CHAR(36),
IN p_id_user CHAR(36),
IN p_id_program CHAR(36),
IN p_token_hash VARCHAR(512),
IN p_token_salt VARCHAR(512),
IN p_expires_in_seconds INT,
@@ -18,6 +19,7 @@ BEGIN
(
id_refresh_token,
id_user,
id_program,
token_hash,
token_salt,
expires_at,
@@ -28,6 +30,7 @@ BEGIN
(
p_id_refresh_token,
p_id_user,
p_id_program,
p_token_hash,
p_token_salt,
DATE_ADD(UTC_TIMESTAMP(), INTERVAL p_expires_in_seconds SECOND),
@@ -4,6 +4,7 @@ BEGIN
SELECT
id_student,
id_program,
id_user,
identifier,
program_year,
enrollment_date,
@@ -4,6 +4,7 @@ BEGIN
SELECT
id_student,
id_program,
id_user,
identifier,
program_year,
enrollment_date,
@@ -6,6 +6,7 @@ BEGIN
SELECT
id_student,
id_program,
id_user,
identifier,
program_year,
enrollment_date,
@@ -7,14 +7,14 @@ 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
JOIN user_student us ON us.id_student = s.id_student
WHERE us.id_user = p_id_user
WHERE s.id_user = p_id_user
AND s.id_program = p_id_program
ORDER BY s.id_student;
END;;
+4 -16
View File
@@ -2,6 +2,7 @@ DELIMITER ;;
CREATE DEFINER=`root`@`%` PROCEDURE `sp_Student_Insert`(
IN p_id_student CHAR(36),
IN p_id_program CHAR(36),
IN p_id_user CHAR(36),
IN p_identifier VARCHAR(50),
IN p_program_year INT,
IN p_enrollment_date DATE,
@@ -12,6 +13,7 @@ BEGIN
(
id_student,
id_program,
id_user,
identifier,
program_year,
enrollment_date,
@@ -22,31 +24,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,