new-grid adapt2 revision

parent 7beaabea
-- Correccion de integridad por error en DEV, antes de cambiar los nombres
SET FOREIGN_KEY_CHECKS = 0; SET FOREIGN_KEY_CHECKS = 0;
-- Purgamos base de datos antes
DELETE FROM stu_picto WHERE id_scene NOT IN (SELECT s.id FROM scene s); DELETE FROM stu_picto WHERE id_scene NOT IN (SELECT s.id FROM scene s);
ALTER TABLE `stu_picto` ADD CONSTRAINT `stu_picto_scene_fk` FOREIGN KEY (`id_scene`) REFERENCES `scene` (`id`) ON DELETE CASCADE;
-- ---------------------------------------------------------------------------- -- ----------------------------------------------------------------------------
-- CAMBIOS EN EL SCHEMA DE pictodb -- CAMBIOS EN EL SCHEMA DE pictodb
...@@ -9,11 +9,11 @@ ALTER TABLE `stu_picto` ADD CONSTRAINT `stu_picto_scene_fk` FOREIGN KEY (`id_sce ...@@ -9,11 +9,11 @@ ALTER TABLE `stu_picto` ADD CONSTRAINT `stu_picto_scene_fk` FOREIGN KEY (`id_sce
RENAME TABLE `scene` TO `grid`; RENAME TABLE `scene` TO `grid`;
ALTER TABLE `student` CHANGE `id_active_scene` `id_active_grid` int(11) NULL; ALTER TABLE `student` CHANGE `id_active_scene` `id_active_grid` int(11) NULL;
ALTER TABLE `stu_picto` ADD `id_grid` int(11) NOT NULL; ALTER TABLE `stu_picto` ADD `id_grid` int(11) NOT NULL;
ALTER TABLE `stu_picto` ADD `id_child_grid` int(11) NULL; ALTER TABLE `stu_picto` ADD `id_child_grid` int(11) NULL;
ALTER TABLE `stu_picto` DROP COLUMN `id_scene`; ALTER TABLE `stu_picto` DROP COLUMN `id_scene`;
ALTER TABLE `stu_picto` ADD FOREIGN KEY(id_child_grid) REFERENCES grid(id) ON DELETE SET NULL; ALTER TABLE `stu_picto` ADD FOREIGN KEY(`id_child_grid`) REFERENCES `grid`(`id`) ON DELETE SET NULL;
ALTER TABLE `stu_picto` ADD FOREIGN KEY(`id_grid`) REFERENCES `grid`(`id`) ON DELETE CASCADE;
ALTER TABLE `grid` DROP COLUMN `categories`; ALTER TABLE `grid` DROP COLUMN `categories`;
ALTER TABLE `grid` ADD `color` varchar(7) NULL; ALTER TABLE `grid` ADD `color` varchar(7) NULL;
......
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