Commit 296ba636 by Jose Antonio

Merge remote-tracking branch 'origin/develop' into develop

parents a2cc490d 71d320ec
...@@ -7,7 +7,7 @@ SET @TRIGGER_CHECKS = FALSE; ...@@ -7,7 +7,7 @@ SET @TRIGGER_CHECKS = FALSE;
-- Oficina -- Oficina
-- --
INSERT INTO `office` ( INSERT INTO `office` (
`name`, `name`,
`address`, `address`,
`country`, `country`,
...@@ -16,7 +16,7 @@ INSERT INTO `office` ( ...@@ -16,7 +16,7 @@ INSERT INTO `office` (
`phone1`, `phone1`,
`lang`, `lang`,
`postal_code` `postal_code`
) VALUES ( ) VALUES (
'Comunicación Aumentativa JAén (CAJA)', 'Comunicación Aumentativa JAén (CAJA)',
'Paraje Las Lagunillas, Ed A3, primera plata, 23071. Jaén', 'Paraje Las Lagunillas, Ed A3, primera plata, 23071. Jaén',
'ES', 'ES',
...@@ -25,13 +25,13 @@ INSERT INTO `office` ( ...@@ -25,13 +25,13 @@ INSERT INTO `office` (
'+34 953 21 28 88', '+34 953 21 28 88',
'es-es', 'es-es',
'23071' '23071'
); );
-- --
-- Supervisores -- Supervisores
-- --
INSERT INTO `supervisor` ( INSERT INTO `supervisor` (
`name`, `name`,
`surname`, `surname`,
`gender`, `gender`,
...@@ -41,9 +41,10 @@ INSERT INTO `supervisor` ( ...@@ -41,9 +41,10 @@ INSERT INTO `supervisor` (
`lang`, `lang`,
`password`, `password`,
`active`, `active`,
`postal_code`,
`id_off`, `id_off`,
`pic` `pic`
) VALUES ( ) VALUES (
'Fernando', 'Fernando',
'Martínez Santiago', 'Martínez Santiago',
'M', 'M',
...@@ -53,9 +54,10 @@ INSERT INTO `supervisor` ( ...@@ -53,9 +54,10 @@ INSERT INTO `supervisor` (
'es-es', 'es-es',
'$2a$10$Q4jHNlC58.ptfl/5wZeHfOIvpJslJHKOFNZO3bWs4it7TifQPQnEa', '$2a$10$Q4jHNlC58.ptfl/5wZeHfOIvpJslJHKOFNZO3bWs4it7TifQPQnEa',
true, true,
'23071',
(SELECT id from office where email='dofer@ujaen.es'), (SELECT id from office where email='dofer@ujaen.es'),
'test_caja_dofer.jpg' 'test_caja_dofer.jpg'
), ( ), (
'Miguel Ángel', 'Miguel Ángel',
'García Cumbreras', 'García Cumbreras',
'M', 'M',
...@@ -65,9 +67,10 @@ INSERT INTO `supervisor` ( ...@@ -65,9 +67,10 @@ INSERT INTO `supervisor` (
'es-es', 'es-es',
'$2a$04$XQvWUwGTvjR47ChPwd3f6ukx8Zg.7o1N4Kf6P.zqhVtQxVNArOsXi', '$2a$04$XQvWUwGTvjR47ChPwd3f6ukx8Zg.7o1N4Kf6P.zqhVtQxVNArOsXi',
true, true,
'23071',
(SELECT id from office where email='dofer@ujaen.es'), (SELECT id from office where email='dofer@ujaen.es'),
'test_caja_miguel.jpg' 'test_caja_miguel.jpg'
), ( ), (
'Arturo', 'Arturo',
'Montejo Ráez', 'Montejo Ráez',
'M', 'M',
...@@ -77,9 +80,10 @@ INSERT INTO `supervisor` ( ...@@ -77,9 +80,10 @@ INSERT INTO `supervisor` (
'es-es', 'es-es',
'$2a$04$yoBXAMSgCVGSIr2pnuIOw.J8UCm8f2XkATu5rqsMJiEmlxBHs5.cO', '$2a$04$yoBXAMSgCVGSIr2pnuIOw.J8UCm8f2XkATu5rqsMJiEmlxBHs5.cO',
true, true,
'23071',
(SELECT id from office where email='dofer@ujaen.es'), (SELECT id from office where email='dofer@ujaen.es'),
'test_caja_arturo.jpg' 'test_caja_arturo.jpg'
), ( ), (
'Alfonso', 'Alfonso',
'Ureña López', 'Ureña López',
'M', 'M',
...@@ -89,9 +93,10 @@ INSERT INTO `supervisor` ( ...@@ -89,9 +93,10 @@ INSERT INTO `supervisor` (
'es-es', 'es-es',
'$2a$04$zVGHJFafoZa60wo1yBqF/Oi3RXV/qS2cq0/j/W3Dkf4P1ad0e7.iS', '$2a$04$zVGHJFafoZa60wo1yBqF/Oi3RXV/qS2cq0/j/W3Dkf4P1ad0e7.iS',
true, true,
'23071',
(SELECT id from office where email='dofer@ujaen.es'), (SELECT id from office where email='dofer@ujaen.es'),
'test_caja_alfonso.jpg' 'test_caja_alfonso.jpg'
), ( ), (
'Jesús', 'Jesús',
'Navarro Moreno', 'Navarro Moreno',
'M', 'M',
...@@ -101,9 +106,10 @@ INSERT INTO `supervisor` ( ...@@ -101,9 +106,10 @@ INSERT INTO `supervisor` (
'es-es', 'es-es',
'$2a$04$8O3Jd5j9/nM/KC.b1a8qRevyUwWUx6XGU3Gm754Y/8PpLO2jv.i76', '$2a$04$8O3Jd5j9/nM/KC.b1a8qRevyUwWUx6XGU3Gm754Y/8PpLO2jv.i76',
true, true,
'23071',
(SELECT id from office where email='dofer@ujaen.es'), (SELECT id from office where email='dofer@ujaen.es'),
'defaultAvatar.jpg' 'defaultAvatar.jpg'
); );
-- --
-- Tutores -- Tutores
...@@ -119,7 +125,8 @@ INSERT INTO `supervisor` ( ...@@ -119,7 +125,8 @@ INSERT INTO `supervisor` (
`phone`, `phone`,
`lang`, `lang`,
`password`, `password`,
`active` `active`,
`postal_code`
) VALUES ( ) VALUES (
'Don Fernando', 'Don Fernando',
'Padre Fernandito', 'Padre Fernandito',
...@@ -130,7 +137,8 @@ INSERT INTO `supervisor` ( ...@@ -130,7 +137,8 @@ INSERT INTO `supervisor` (
'+34 232 232 232', '+34 232 232 232',
'es-es', 'es-es',
'$2a$04$DMOX/cZ4h6cNJW9VlCou7O266q4YDYuS6p0QzP.gBHd08.QnFQWD.', '$2a$04$DMOX/cZ4h6cNJW9VlCou7O266q4YDYuS6p0QzP.gBHd08.QnFQWD.',
true true,
'23071'
), ( ), (
'Don Arturo', 'Don Arturo',
'Padre Arturito', 'Padre Arturito',
...@@ -141,7 +149,8 @@ INSERT INTO `supervisor` ( ...@@ -141,7 +149,8 @@ INSERT INTO `supervisor` (
NULL, NULL,
'es-es', 'es-es',
'$2a$04$V2ods9MMmOFvdLTaHJqk3ejKEYdf28gvfDhaBkOSLCFJOC02TweFK', '$2a$04$V2ods9MMmOFvdLTaHJqk3ejKEYdf28gvfDhaBkOSLCFJOC02TweFK',
true true,
'23071'
), ( ), (
'Don Miguel', 'Don Miguel',
'Padre Miguelito', 'Padre Miguelito',
...@@ -152,9 +161,10 @@ INSERT INTO `supervisor` ( ...@@ -152,9 +161,10 @@ INSERT INTO `supervisor` (
NULL, NULL,
'es-es', 'es-es',
'$2a$04$1UCak614LKz6WpDBtOblQeqFF41tOMy6ERMnP2OuGVZffe8Yi0mJq', '$2a$04$1UCak614LKz6WpDBtOblQeqFF41tOMy6ERMnP2OuGVZffe8Yi0mJq',
true true,
'23071'
), ( ), (
'Don Afonso', 'Don Alfonso',
'Padre Alfonsito', 'Padre Alfonsito',
'M', 'M',
'Avda. Andalucía 1. Jaén', 'Avda. Andalucía 1. Jaén',
...@@ -162,8 +172,9 @@ INSERT INTO `supervisor` ( ...@@ -162,8 +172,9 @@ INSERT INTO `supervisor` (
'donalfonso@gmail.com', 'donalfonso@gmail.com',
NULL, NULL,
'es-es', 'es-es',
'$2a$04$$2a$04$KktXwe06AJg3vMUEX1E1/esbP.g8f79mtcNGjCsrEDWktmegcML4q', '$2a$06$UtyBV4tLlT7xSqIt8LKPBucGvZ.Wgf7RgGE0fRcjEBDwjxjHlsP3K',
true true,
'23071'
), ( ), (
'Doña Alfonsa', 'Doña Alfonsa',
'Madre Alfonsita', 'Madre Alfonsita',
...@@ -174,7 +185,8 @@ INSERT INTO `supervisor` ( ...@@ -174,7 +185,8 @@ INSERT INTO `supervisor` (
NULL, NULL,
'es-es', 'es-es',
'$2a$04$ALDmQ1oRhRZKUEi1b0eK1ehQmSZiFkhzx48ZBwER0J4vakvlYc5VS', '$2a$04$ALDmQ1oRhRZKUEi1b0eK1ehQmSZiFkhzx48ZBwER0J4vakvlYc5VS',
true true,
'23071'
), ( ), (
'Don Jesús', 'Don Jesús',
'Padre Jesusito', 'Padre Jesusito',
...@@ -185,7 +197,8 @@ INSERT INTO `supervisor` ( ...@@ -185,7 +197,8 @@ INSERT INTO `supervisor` (
NULL, NULL,
'es-es', 'es-es',
'$2a$04$Psuu6IMPUj1sbzR.uxq3EOgX1/4dFNmccjkv76LhKp35JzpiCE.fm', '$2a$04$Psuu6IMPUj1sbzR.uxq3EOgX1/4dFNmccjkv76LhKp35JzpiCE.fm',
true true,
'23071'
); );
-- --
...@@ -383,42 +396,42 @@ UPDATE student SET id_off=(SELECT id_off FROM supervisor WHERE supervisor.name=' ...@@ -383,42 +396,42 @@ UPDATE student SET id_off=(SELECT id_off FROM supervisor WHERE supervisor.name='
UPDATE student SET id_off=(SELECT id_off FROM supervisor WHERE supervisor.name='Jesús') WHERE student.name='Jesusito'; UPDATE student SET id_off=(SELECT id_off FROM supervisor WHERE supervisor.name='Jesús') WHERE student.name='Jesusito';
UPDATE student SET id_off=(SELECT id_off FROM supervisor WHERE supervisor.name='Jesús') WHERE student.name='Jesusita'; UPDATE student SET id_off=(SELECT id_off FROM supervisor WHERE supervisor.name='Jesús') WHERE student.name='Jesusita';
select a.name,b.attributes,text from student a, stu_picto b, picto c, picto_exp d where a.id=b.id_stu and b.id_pic=c.id and c.id=d.id_pic and a.id=23 and a.lang=d.lang; // select a.name,b.attributes,text from student a, stu_picto b, picto c, picto_exp d where a.id=b.id_stu and b.id_pic=c.id and c.id=d.id_pic and a.id=23 and a.lang=d.lang;
-- --
-- CAJA Core vocabulary -- CAJA Core vocabulary
-- --
--
INSERT INTO stu_picto(id_stu,id_pic,attributes) -- INSERT INTO stu_picto(id_stu,id_pic,scene,attributes)
SELECT S.id,P.id_pic, concat('{"id_cat":', if (id_cat_pic is null, 'null',id_cat_pic), -- SELECT S.id,P.id_pic, concat('{"id_cat":', if (id_cat_pic is null, 'null',id_cat_pic),
',"coord_x":',coord_x, -- ',"coord_x":',coord_x,
',"coord_y":',coord_y, -- ',"coord_y":',coord_y,
',"status":"invisible"', -- ',"status":"invisible"',
',"highlight":false', -- ',"highlight":false',
',"color":', if (color is null, 'null',concat('"',color,'"')), -- ',"color":', if (color is null, 'null',concat('"',color,'"')),
'}') as attributes -- '}') as attributes
FROM student S, picto_core P -- FROM student S, picto_core P
WHERE S.id_off =(SELECT id from office where name='Comunicación Aumentativa JAén (CAJA)'); -- WHERE S.id_off =(SELECT id from office where name='Comunicación Aumentativa JAén (CAJA)');
-- --
-- Test method -- Test method
-- --
INSERT INTO meta_method(name) VALUES ( -- INSERT INTO meta_method(name) VALUES (
'Test MetaMethod' -- 'Test MetaMethod'
); -- );
INSERT INTO method(name, id_stu) VALUES ( -- INSERT INTO method(name, id_stu) VALUES (
'Test Method', -- 'Test Method',
(SELECT id FROM student WHERE username='aaa0002') -- (SELECT id FROM student WHERE username='aaa0002')
); -- );
INSERT INTO instruction(name, id_met) VALUES ( -- INSERT INTO instruction(name, id_met) VALUES (
'Test Instruction', -- 'Test Instruction',
(SELECT id FROM method WHERE name='Test Method') -- (SELECT id FROM method WHERE name='Test Method')
); -- );
INSERT INTO working_session (id_sup, id_ins) VALUES ( -- INSERT INTO working_session (id_sup, id_ins) VALUES (
(SELECT id FROM supervisor WHERE email='dofer@ujaen.es'), -- (SELECT id FROM supervisor WHERE email='dofer@ujaen.es'),
(SELECT id FROM instruction WHERE name='Test Instruction') -- (SELECT id FROM instruction WHERE name='Test Instruction')
); -- );
SET @TRIGGER_CHECKS = TRUE; SET @TRIGGER_CHECKS = TRUE;
SET foreign_key_checks=1; SET foreign_key_checks=1;
...@@ -4,20 +4,7 @@ Changes to be performed manually in servers to upgrade ...@@ -4,20 +4,7 @@ Changes to be performed manually in servers to upgrade
## Database ## Database
- Reload triggers-session-constraints.sql Already done in dev:
- Delete active column from scene table (deleted from `already done in dev` sql `create scene table` statement)
`alter table scene drop active;`
- Add id_active_scene to student table
`ALTER TABLE student ADD COLUMN id_active_scene INT(11) DEFAULT NULL;`
`ALTER TABLE student ADD CONSTRAINT fk_active_scene FOREIGN KEY (`id_active_scene`) REFERENCES scene (`id`);`
- Reload enrolments trigger
`source /vagrant/roles/database/files/triggers-enrolments-integrity-constraints.sql;`
(already done in dev)
- update arasaac uri - update arasaac uri
`source update_arasaac_color_uri.sql` `source update_arasaac_color_uri.sql`
...@@ -38,6 +25,10 @@ Changes to be performed manually in servers to upgrade ...@@ -38,6 +25,10 @@ Changes to be performed manually in servers to upgrade
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1
COMMENT="Scene table information. Every scene is related to some stu_pictos";` COMMENT="Scene table information. Every scene is related to some stu_pictos";`
- Add id_active_scene to student table
`ALTER TABLE student ADD COLUMN id_active_scene INT(11) DEFAULT NULL;`
`ALTER TABLE student ADD CONSTRAINT fk_active_scene FOREIGN KEY (`id_active_scene`) REFERENCES scene (`id`);`
- alter table stu_picto to add new reference to scene - alter table stu_picto to add new reference to scene
`ALTER TABLE `stu_picto` ADD id_scene int(11) NOT NULL;` `ALTER TABLE `stu_picto` ADD id_scene int(11) NOT NULL;`
`ALTER TABLE `stu_picto` ADD CONSTRAINT `stu_picto_scene_fk` FOREIGN KEY (`id_scene`) REFERENCES `scene` (`id`) ON DELETE CASCADE;` `ALTER TABLE `stu_picto` ADD CONSTRAINT `stu_picto_scene_fk` FOREIGN KEY (`id_scene`) REFERENCES `scene` (`id`) ON DELETE CASCADE;`
...@@ -48,3 +39,5 @@ Changes to be performed manually in servers to upgrade ...@@ -48,3 +39,5 @@ Changes to be performed manually in servers to upgrade
- Reload enrolments trigger - Reload enrolments trigger
`source /vagrant/roles/database/files/triggers-enrolments-integrity-constraints.sql` `source /vagrant/roles/database/files/triggers-enrolments-integrity-constraints.sql`
- Reload triggers-sessions-integrity-constraints.sql
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