Commit 296ba636 by Jose Antonio

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

parents a2cc490d 71d320ec
...@@ -7,103 +7,109 @@ SET @TRIGGER_CHECKS = FALSE; ...@@ -7,103 +7,109 @@ SET @TRIGGER_CHECKS = FALSE;
-- Oficina -- Oficina
-- --
INSERT INTO `office` ( INSERT INTO `office` (
`name`, `name`,
`address`, `address`,
`country`, `country`,
`contact_person`, `contact_person`,
`email`, `email`,
`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',
'Fernando Martínez Santiago', 'Fernando Martínez Santiago',
'dofer@ujaen.es', 'dofer@ujaen.es',
'+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`,
`address`, `address`,
`email`, `email`,
`phone`, `phone`,
`lang`, `lang`,
`password`, `password`,
`active`, `active`,
`id_off`, `postal_code`,
`pic` `id_off`,
) VALUES ( `pic`
'Fernando', ) VALUES (
'Martínez Santiago', 'Fernando',
'M', 'Martínez Santiago',
NULL, 'M',
'dofer@ujaen.es', NULL,
'+34953212888', 'dofer@ujaen.es',
'es-es', '+34953212888',
'$2a$10$Q4jHNlC58.ptfl/5wZeHfOIvpJslJHKOFNZO3bWs4it7TifQPQnEa', 'es-es',
true, '$2a$10$Q4jHNlC58.ptfl/5wZeHfOIvpJslJHKOFNZO3bWs4it7TifQPQnEa',
(SELECT id from office where email='dofer@ujaen.es'), true,
'test_caja_dofer.jpg' '23071',
), ( (SELECT id from office where email='dofer@ujaen.es'),
'Miguel Ángel', 'test_caja_dofer.jpg'
'García Cumbreras', ), (
'M', 'Miguel Ángel',
NULL, 'García Cumbreras',
'magc@ujaen.es', 'M',
'+34953212420', NULL,
'es-es', 'magc@ujaen.es',
'$2a$04$XQvWUwGTvjR47ChPwd3f6ukx8Zg.7o1N4Kf6P.zqhVtQxVNArOsXi', '+34953212420',
true, 'es-es',
(SELECT id from office where email='dofer@ujaen.es'), '$2a$04$XQvWUwGTvjR47ChPwd3f6ukx8Zg.7o1N4Kf6P.zqhVtQxVNArOsXi',
'test_caja_miguel.jpg' true,
), ( '23071',
'Arturo', (SELECT id from office where email='dofer@ujaen.es'),
'Montejo Ráez', 'test_caja_miguel.jpg'
'M', ), (
NULL, 'Arturo',
'amontejo@ujaen.es', 'Montejo Ráez',
'+34953212882', 'M',
'es-es', NULL,
'$2a$04$yoBXAMSgCVGSIr2pnuIOw.J8UCm8f2XkATu5rqsMJiEmlxBHs5.cO', 'amontejo@ujaen.es',
true, '+34953212882',
(SELECT id from office where email='dofer@ujaen.es'), 'es-es',
'test_caja_arturo.jpg' '$2a$04$yoBXAMSgCVGSIr2pnuIOw.J8UCm8f2XkATu5rqsMJiEmlxBHs5.cO',
), ( true,
'Alfonso', '23071',
'Ureña López', (SELECT id from office where email='dofer@ujaen.es'),
'M', 'test_caja_arturo.jpg'
NULL, ), (
'laurena@ujaen.es', 'Alfonso',
'+34953212895', 'Ureña López',
'es-es', 'M',
'$2a$04$zVGHJFafoZa60wo1yBqF/Oi3RXV/qS2cq0/j/W3Dkf4P1ad0e7.iS', NULL,
true, 'laurena@ujaen.es',
(SELECT id from office where email='dofer@ujaen.es'), '+34953212895',
'test_caja_alfonso.jpg' 'es-es',
), ( '$2a$04$zVGHJFafoZa60wo1yBqF/Oi3RXV/qS2cq0/j/W3Dkf4P1ad0e7.iS',
'Jesús', true,
'Navarro Moreno', '23071',
'M', (SELECT id from office where email='dofer@ujaen.es'),
NULL, 'test_caja_alfonso.jpg'
'jnavarro@ujaen.es', ), (
'+34953211912', 'Jesús',
'es-es', 'Navarro Moreno',
'$2a$04$8O3Jd5j9/nM/KC.b1a8qRevyUwWUx6XGU3Gm754Y/8PpLO2jv.i76', 'M',
true, NULL,
(SELECT id from office where email='dofer@ujaen.es'), 'jnavarro@ujaen.es',
'defaultAvatar.jpg' '+34953211912',
); 'es-es',
'$2a$04$8O3Jd5j9/nM/KC.b1a8qRevyUwWUx6XGU3Gm754Y/8PpLO2jv.i76',
true,
'23071',
(SELECT id from office where email='dofer@ujaen.es'),
'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,18 +161,20 @@ INSERT INTO `supervisor` ( ...@@ -152,18 +161,20 @@ 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',
'ES', 'ES',
'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