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
897c69d3
authored
Apr 17, 2017
by
Jose Antonio
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Scene SQL - not finished
parent
e6607142
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
10 deletions
sails/roles/database/files/pictodb-schema.sql
sails/roles/database/files/scene_adapt.sql
sails/src/CHANGES.md
sails/roles/database/files/pictodb-schema.sql
View file @
897c69d3
...
@@ -441,9 +441,9 @@ COMMENT="This table stores working session information. Every working session is
...
@@ -441,9 +441,9 @@ COMMENT="This table stores working session information. Every working session is
CREATE
TABLE
IF
NOT
EXISTS
`scene`
(
CREATE
TABLE
IF
NOT
EXISTS
`scene`
(
`id`
int
(
11
)
NOT
NULL
AUTO_INCREMENT
,
`id`
int
(
11
)
NOT
NULL
AUTO_INCREMENT
,
`name`
varchar
(
100
)
COLLATE
utf8_unicode_ci
DEFAULT
NULL
,
`name`
varchar
(
100
)
COLLATE
utf8_unicode_ci
DEFAULT
NULL
,
`active`
boolean
NULL
DEFAULT
0
,
`active`
boolean
N
OT
N
ULL
DEFAULT
0
,
`categories`
boolean
NULL
DEFAULT
0
,
`categories`
boolean
N
OT
N
ULL
DEFAULT
0
,
`id_sup`
int
(
11
)
NO
T
NULL
,
`id_sup`
int
(
11
)
DEFAUL
T
NULL
,
`id_stu`
int
(
11
)
NOT
NULL
,
`id_stu`
int
(
11
)
NOT
NULL
,
PRIMARY
KEY
(
`id`
),
PRIMARY
KEY
(
`id`
),
FOREIGN
KEY
(
`id_sup`
)
REFERENCES
`supervisor`
(
`id`
),
FOREIGN
KEY
(
`id_sup`
)
REFERENCES
`supervisor`
(
`id`
),
...
...
sails/roles/database/files/scene_adapt.sql
View file @
897c69d3
...
@@ -13,6 +13,7 @@ CREATE PROCEDURE scene_adapt()
...
@@ -13,6 +13,7 @@ CREATE PROCEDURE scene_adapt()
BEGIN
BEGIN
DECLARE
_id_stu
INT
;
DECLARE
_id_stu
INT
;
DECLARE
_id_sup
INT
;
DECLARE
_id_sup
INT
;
DECLARE
cat_active
BOOLEAN
;
DECLARE
done
INT
DEFAULT
FALSE
;
DECLARE
done
INT
DEFAULT
FALSE
;
DECLARE
LID
INT
;
DECLARE
LID
INT
;
...
@@ -30,11 +31,14 @@ BEGIN
...
@@ -30,11 +31,14 @@ BEGIN
LEAVE
read_loop
;
LEAVE
read_loop
;
END
IF
;
END
IF
;
SELECT
`id_sup`
INTO
_id_sup
FROM
`stu_sup`
WHERE
`id_stu`
=
_id_stu
LIMIT
1
;
SELECT
attributes
->
"$.categories"
INTO
cat_active
FROM
student
WHERE
id
=
_id_stu
;
SET
cat_active
=
0
;
SELECT
CONCAT
(
'active: '
,
cat_active
);
SELECT
CONCAT
(
'active: '
,
NOT
cat_active
);
/* FIRST SCENE, ACTIVE, WITH CATEGORIES */
/* FIRST SCENE, ACTIVE, WITH CATEGORIES */
INSERT
INTO
`scene`
(
name
,
active
,
categories
,
id_s
up
,
id_s
tu
)
INSERT
INTO
`scene`
(
name
,
active
,
categories
,
id_stu
)
VALUES
(
'with_categories'
,
1
,
1
,
_id_sup
,
_id_stu
);
VALUES
(
'with_categories'
,
cat_active
,
1
,
_id_stu
);
SET
LID
=
LAST_INSERT_ID
();
SET
LID
=
LAST_INSERT_ID
();
...
@@ -46,7 +50,7 @@ BEGIN
...
@@ -46,7 +50,7 @@ BEGIN
/* SECOND SCENE, NOT ACTIVE, NO CATEGORIES */
/* SECOND SCENE, NOT ACTIVE, NO CATEGORIES */
INSERT
INTO
`scene`
(
name
,
active
,
categories
,
id_sup
,
id_stu
)
INSERT
INTO
`scene`
(
name
,
active
,
categories
,
id_sup
,
id_stu
)
VALUES
(
'no_categories'
,
0
,
0
,
_id_sup
,
_id_stu
);
VALUES
(
'no_categories'
,
NOT
cat_active
,
0
,
_id_sup
,
_id_stu
);
SET
LID
=
LAST_INSERT_ID
();
SET
LID
=
LAST_INSERT_ID
();
...
...
sails/src/CHANGES.md
View file @
897c69d3
...
@@ -23,9 +23,9 @@ Changes to be performed manually in servers to upgrade
...
@@ -23,9 +23,9 @@ Changes to be performed manually in servers to upgrade
`CREATE TABLE IF NOT EXISTS `
scene
` (
`CREATE TABLE IF NOT EXISTS `
scene
` (
`
id
` int(11) NOT NULL AUTO_INCREMENT,
`
id
` int(11) NOT NULL AUTO_INCREMENT,
`
name
` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`
name
` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`
active
` boolean NULL DEFAULT 0,
`
active
` boolean N
OT N
ULL DEFAULT 0,
`
categories
` boolean NULL DEFAULT 0,
`
categories
` boolean N
OT N
ULL DEFAULT 0,
`
id_sup
` int(11)
NO
T NULL,
`
id_sup
` int(11)
DEFAUL
T NULL,
`
id_stu
` int(11) NOT NULL,
`
id_stu
` int(11) NOT NULL,
PRIMARY KEY (`
id
`),
PRIMARY KEY (`
id
`),
FOREIGN KEY (`
id_sup
`) REFERENCES `
supervisor
` (`
id
`),
FOREIGN KEY (`
id_sup
`) REFERENCES `
supervisor
` (`
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