scene_adapt.sql hotfix

parent fbfc102f
Showing with 2 additions and 14 deletions
...@@ -13,8 +13,6 @@ CREATE PROCEDURE scene_adapt() ...@@ -13,8 +13,6 @@ CREATE PROCEDURE scene_adapt()
BEGIN BEGIN
DECLARE _id_stu INT; DECLARE _id_stu INT;
DECLARE _id_sup INT; DECLARE _id_sup INT;
DECLARE _cat_status CHAR(10);
DECLARE _cat_active BOOLEAN;
DECLARE done INT DEFAULT FALSE; DECLARE done INT DEFAULT FALSE;
DECLARE LID INT; DECLARE LID INT;
...@@ -32,19 +30,9 @@ BEGIN ...@@ -32,19 +30,9 @@ BEGIN
LEAVE read_loop; LEAVE read_loop;
END IF; END IF;
SELECT CAST(attributes->"$.categories" as CHAR(10)) INTO _cat_status FROM student WHERE id = _id_stu;
IF (_cat_status LIKE '%on%') THEN
SET _cat_active = 1;
/*SELECT CONCAT('active: ', _cat_active);*/
ELSE
SET _cat_active = 0;
/*SELECT CONCAT('active: ', NOT _cat_active);*/
END IF;
/* FIRST SCENE, ACTIVE, WITH CATEGORIES*/ /* FIRST SCENE, ACTIVE, WITH CATEGORIES*/
INSERT INTO `scene` (name, categories, id_stu) INSERT INTO `scene` (name, categories, id_stu)
VALUES ('Con categorías', _cat_active, _id_stu); VALUES ('Con categorías', 1, _id_stu);
SET LID = LAST_INSERT_ID(); SET LID = LAST_INSERT_ID();
...@@ -58,7 +46,7 @@ BEGIN ...@@ -58,7 +46,7 @@ BEGIN
/* SECOND SCENE, NOT ACTIVE, NO CATEGORIES*/ /* SECOND SCENE, NOT ACTIVE, NO CATEGORIES*/
INSERT INTO `scene` (name, categories, id_sup, id_stu) INSERT INTO `scene` (name, categories, id_sup, id_stu)
VALUES ('Sin categorías', NOT _cat_active, _id_sup, _id_stu); VALUES ('Sin categorías', 0, _id_sup, _id_stu);
SET LID = LAST_INSERT_ID(); SET LID = LAST_INSERT_ID();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment