From 0a37f6d84828a561bd8b5b74b09ebc8fdfe3ea7d Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Wed, 27 Feb 2019 11:32:39 +0100 Subject: [PATCH 1/2] add changes to migrate script Former-commit-id: 7e1beeed2a8ff709cdd2e2ff992b610cd4aa7409 --- .../pandoradb_migrate_6.0_to_7.0.mysql.sql | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index 2492a9913f..a60e6bfd8a 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -1900,14 +1900,18 @@ CREATE TABLE IF NOT EXISTS `tevent_extended` ( -- ----------------------------------------------------- -- Table `tgis_map_layer_groups` -- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `tgis_map_layer_groups` ( - `layer_id` INT NOT NULL, - `group_id` MEDIUMINT(4) UNSIGNED NOT NULL, - `agent_id` INT(10) UNSIGNED NOT NULL COMMENT 'Used to link the position to the group', - PRIMARY KEY (`layer_id`, `group_id`), - FOREIGN KEY (`layer_id`) REFERENCES `tgis_map_layer` (`id_tmap_layer`) ON DELETE CASCADE, - FOREIGN KEY (`group_id`) REFERENCES `tgrupo` (`id_grupo`) ON DELETE CASCADE, - FOREIGN KEY (`agent_id`) REFERENCES `tagente` (`id_agente`) ON DELETE CASCADE +DROP TABLE IF EXISTS `tgis_map_layer_groups`; + +CREATE TABLE `tgis_map_layer_groups` ( + `layer_id` int(11) NOT NULL, + `group_id` mediumint(4) unsigned NOT NULL, + `agent_id` int(10) unsigned NOT NULL COMMENT 'Used to link the position to the group', + PRIMARY KEY (`layer_id`,`group_id`), + KEY `group_id` (`group_id`), + KEY `agent_id` (`agent_id`), + CONSTRAINT `tgis_map_layer_groups_ibfk_1` FOREIGN KEY (`layer_id`) REFERENCES `tgis_map_layer` (`id_tmap_layer`) ON DELETE CASCADE, + CONSTRAINT `tgis_map_layer_groups_ibfk_2` FOREIGN KEY (`group_id`) REFERENCES `tgrupo` (`id_grupo`) ON DELETE CASCADE, + CONSTRAINT `tgis_map_layer_groups_ibfk_3` FOREIGN KEY (`agent_id`) REFERENCES `tagente` (`id_agente`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ----------------------------------------------------- @@ -2018,6 +2022,11 @@ CREATE TABLE `tnotification_source_group_user` ( ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +-- ---------------------------------------------------------------------- +-- Table `tuser_task_scheduled` +-- ---------------------------------------------------------------------- +ALTER TABLE `tuser_task_scheduled` ADD COLUMN `flag_delete` tinyint(1) unsigned NOT NULL DEFAULT '0'; + -- ---------------------------------------------------------------------- -- Add alert command 'Generate notification' -- ---------------------------------------------------------------------- From 4943521904091be8585e867c749cd0e518c5448e Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Tue, 5 Mar 2019 15:28:39 +0100 Subject: [PATCH 2/2] fix pandora migrate script Former-commit-id: 0d66837bf3f842aed32c3c64edc2608580d6ed7f --- .../extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 7 ------- 1 file changed, 7 deletions(-) diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index a60e6bfd8a..7028955322 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -1900,8 +1900,6 @@ CREATE TABLE IF NOT EXISTS `tevent_extended` ( -- ----------------------------------------------------- -- Table `tgis_map_layer_groups` -- ----------------------------------------------------- -DROP TABLE IF EXISTS `tgis_map_layer_groups`; - CREATE TABLE `tgis_map_layer_groups` ( `layer_id` int(11) NOT NULL, `group_id` mediumint(4) unsigned NOT NULL, @@ -2022,11 +2020,6 @@ CREATE TABLE `tnotification_source_group_user` ( ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- ---------------------------------------------------------------------- --- Table `tuser_task_scheduled` --- ---------------------------------------------------------------------- -ALTER TABLE `tuser_task_scheduled` ADD COLUMN `flag_delete` tinyint(1) unsigned NOT NULL DEFAULT '0'; - -- ---------------------------------------------------------------------- -- Add alert command 'Generate notification' -- ----------------------------------------------------------------------