mirror of
https://github.com/opelly27/WinStudentGoalTracker.git
synced 2026-05-20 02:57:36 +00:00
Renamed some of the goal fields to align with business logic
This commit is contained in:
@@ -5,7 +5,7 @@ BEGIN
|
||||
s.`identifier` AS `studentIdentifier`,
|
||||
b.`id_benchmark` AS `benchmarkId`,
|
||||
b.`id_goal` AS `goalId`,
|
||||
g.`title` AS `goalTitle`,
|
||||
g.`category` AS `goalCategory`,
|
||||
b.`benchmark` AS `benchmark`,
|
||||
u.`name` AS `createdByName`,
|
||||
b.`created_at` AS `createdAt`,
|
||||
|
||||
@@ -5,9 +5,9 @@ BEGIN
|
||||
goalId,
|
||||
goalParentId,
|
||||
studentId,
|
||||
title,
|
||||
description,
|
||||
category,
|
||||
baseline,
|
||||
progressEventCount
|
||||
FROM v_goal_card
|
||||
ORDER BY goalId;
|
||||
|
||||
@@ -5,9 +5,9 @@ BEGIN
|
||||
goalId,
|
||||
goalParentId,
|
||||
studentId,
|
||||
title,
|
||||
description,
|
||||
category,
|
||||
baseline,
|
||||
progressEventCount
|
||||
FROM v_goal_card
|
||||
WHERE goalId = p_id_goal
|
||||
|
||||
@@ -5,9 +5,9 @@ BEGIN
|
||||
s.`identifier` AS `studentIdentifier`,
|
||||
vc.`goalId`,
|
||||
vc.`goalParentId`,
|
||||
vc.`title`,
|
||||
vc.`description`,
|
||||
vc.`category`,
|
||||
vc.`baseline`,
|
||||
vc.`progressEventCount`,
|
||||
vc.`benchmarkCount`
|
||||
FROM `v_goal_card` vc
|
||||
|
||||
@@ -4,9 +4,9 @@ CREATE DEFINER=`root`@`%` PROCEDURE `sp_Goal_Insert`(
|
||||
IN p_id_goal_parent CHAR(36),
|
||||
IN p_id_student CHAR(36),
|
||||
IN p_id_user_created CHAR(36),
|
||||
IN p_title VARCHAR(255),
|
||||
IN p_description TEXT,
|
||||
IN p_category VARCHAR(100)
|
||||
IN p_category VARCHAR(255),
|
||||
IN p_baseline TEXT
|
||||
)
|
||||
BEGIN
|
||||
INSERT INTO goal
|
||||
@@ -15,9 +15,9 @@ BEGIN
|
||||
id_goal_parent,
|
||||
id_student,
|
||||
id_user_created,
|
||||
title,
|
||||
description,
|
||||
category,
|
||||
baseline,
|
||||
created_at,
|
||||
updated_at
|
||||
)
|
||||
@@ -27,9 +27,9 @@ BEGIN
|
||||
p_id_goal_parent,
|
||||
p_id_student,
|
||||
p_id_user_created,
|
||||
p_title,
|
||||
p_description,
|
||||
p_category,
|
||||
p_baseline,
|
||||
UTC_TIMESTAMP(),
|
||||
UTC_TIMESTAMP()
|
||||
);
|
||||
@@ -38,9 +38,9 @@ BEGIN
|
||||
id_goal_parent,
|
||||
id_student,
|
||||
id_user_created,
|
||||
title,
|
||||
description,
|
||||
category,
|
||||
baseline,
|
||||
created_at,
|
||||
updated_at
|
||||
FROM goal
|
||||
|
||||
@@ -4,9 +4,9 @@ CREATE DEFINER=`root`@`%` PROCEDURE `sp_Goal_Update`(
|
||||
IN p_id_goal_parent CHAR(36),
|
||||
IN p_id_student CHAR(36),
|
||||
IN p_id_user_created CHAR(36),
|
||||
IN p_title VARCHAR(255),
|
||||
IN p_description TEXT,
|
||||
IN p_category VARCHAR(100)
|
||||
IN p_category VARCHAR(255),
|
||||
IN p_baseline TEXT
|
||||
)
|
||||
BEGIN
|
||||
UPDATE goal
|
||||
@@ -14,9 +14,9 @@ BEGIN
|
||||
id_goal_parent = COALESCE(p_id_goal_parent, id_goal_parent),
|
||||
id_student = COALESCE(p_id_student, id_student),
|
||||
id_user_created = COALESCE(p_id_user_created, id_user_created),
|
||||
title = COALESCE(p_title, title),
|
||||
description = COALESCE(p_description, description),
|
||||
category = COALESCE(p_category, category),
|
||||
baseline = COALESCE(p_baseline, baseline),
|
||||
updated_at = UTC_TIMESTAMP()
|
||||
WHERE id_goal = p_id_goal;
|
||||
SELECT ROW_COUNT() AS rows_affected;
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
DELIMITER ;;
|
||||
CREATE DEFINER=`root`@`%` PROCEDURE `sp_User_SetPassword`(
|
||||
IN p_id_user CHAR(36),
|
||||
IN p_password_hash VARCHAR(255),
|
||||
IN p_password_salt VARCHAR(255)
|
||||
)
|
||||
BEGIN
|
||||
UPDATE user
|
||||
SET password_hash = p_password_hash,
|
||||
password_salt = p_password_salt,
|
||||
password_updated_at = UTC_TIMESTAMP()
|
||||
WHERE id_user = p_id_user;
|
||||
SELECT ROW_COUNT() AS rows_affected;
|
||||
END;;
|
||||
DELIMITER ;
|
||||
@@ -3,9 +3,9 @@ CREATE TABLE `goal` (
|
||||
`id_goal_parent` char(36) DEFAULT NULL,
|
||||
`id_student` char(36) DEFAULT NULL,
|
||||
`id_user_created` char(36) DEFAULT NULL,
|
||||
`title` varchar(255) DEFAULT NULL,
|
||||
`description` text,
|
||||
`category` varchar(100) DEFAULT NULL,
|
||||
`category` varchar(255) DEFAULT NULL,
|
||||
`baseline` text,
|
||||
`created_at` timestamp NULL DEFAULT NULL,
|
||||
`updated_at` timestamp NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id_goal`),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `winstudentgoaltracker`.`v_goal_card` AS
|
||||
select `g`.`id_goal` AS `goalId`,`g`.`id_goal_parent` AS `goalParentId`,`g`.`id_student` AS `studentId`,`g`.`title` AS `title`,`g`.`description` AS `description`,`g`.`category` AS `category`,count(distinct `pe`.`id_progress_event`) AS `progressEventCount`,count(distinct `b`.`id_benchmark`) AS `benchmarkCount`
|
||||
select `g`.`id_goal` AS `goalId`,`g`.`id_goal_parent` AS `goalParentId`,`g`.`id_student` AS `studentId`,`g`.`description` AS `description`,`g`.`category` AS `category`,`g`.`baseline` AS `baseline`,count(distinct `pe`.`id_progress_event`) AS `progressEventCount`,count(distinct `b`.`id_benchmark`) AS `benchmarkCount`
|
||||
from ((`winstudentgoaltracker`.`goal` `g`
|
||||
left
|
||||
join `winstudentgoaltracker`.`progress_event` `pe` on((`pe`.`id_goal` = `g`.`id_goal`)))
|
||||
left
|
||||
join `winstudentgoaltracker`.`benchmark` `b` on((`b`.`id_goal` = `g`.`id_goal`))) group by `g`.`id_goal`,`g`.`id_goal_parent`,`g`.`id_student`,`g`.`title`,`g`.`description`,`g`.`category`;
|
||||
join `winstudentgoaltracker`.`benchmark` `b` on((`b`.`id_goal` = `g`.`id_goal`))) group by `g`.`id_goal`,`g`.`id_goal_parent`,`g`.`id_student`,`g`.`description`,`g`.`category`,`g`.`baseline`;
|
||||
|
||||
Reference in New Issue
Block a user