Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
yotta
/
pictogram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
60
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
71d320ec
authored
May 29, 2017
by
Sebastián Collado Montañez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
scene_adapt.sql hotfix
parent
fbfc102f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
14 deletions
sails/roles/database/files/scene_adapt.sql
sails/roles/database/files/scene_adapt.sql
View file @
71d320ec
...
...
@@ -13,8 +13,6 @@ CREATE PROCEDURE scene_adapt()
BEGIN
DECLARE
_id_stu
INT
;
DECLARE
_id_sup
INT
;
DECLARE
_cat_status
CHAR
(
10
);
DECLARE
_cat_active
BOOLEAN
;
DECLARE
done
INT
DEFAULT
FALSE
;
DECLARE
LID
INT
;
...
...
@@ -32,19 +30,9 @@ BEGIN
LEAVE
read_loop
;
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*/
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
();
...
...
@@ -58,7 +46,7 @@ BEGIN
/* SECOND SCENE, NOT ACTIVE, NO CATEGORIES*/
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
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment