diff --git a/pandora_console/extras/mr/51.sql b/pandora_console/extras/mr/51.sql index 6e256b2cd8..e92d9b853c 100644 --- a/pandora_console/extras/mr/51.sql +++ b/pandora_console/extras/mr/51.sql @@ -44,6 +44,11 @@ ALTER TABLE `talert_special_days` ADD COLUMN `day_code` tinyint(2) unsigned NOT ALTER TABLE `talert_special_days` DROP COLUMN `same_day`; ALTER TABLE `talert_special_days` ADD FOREIGN KEY (`id_calendar`) REFERENCES `talert_calendar`(`id`) ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE `tipam_network` ADD COLUMN `id_site` bigint unsigned; +ALTER TABLE `tipam_network` ADD CONSTRAINT FOREIGN KEY (`id_site`) REFERENCES `tipam_sites`(`id`) ON DELETE SET NULL ON UPDATE CASCADE; +ALTER TABLE `tipam_supernet` ADD COLUMN `id_site` bigint unsigned; +ALTER TABLE `tipam_supernet` ADD CONSTRAINT FOREIGN KEY (`id_site`) REFERENCES `tipam_sites`(`id`) ON DELETE SET NULL ON UPDATE CASCADE; + INSERT IGNORE INTO `talert_calendar` VALUES (1, 'Default', 0, 'Default calendar'); UPDATE `talert_special_days` set `day_code` = 1 WHERE `same_day` = 'monday'; UPDATE `talert_special_days` set `day_code` = 2 WHERE `same_day` = 'tuesday'; 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 a385b8def0..f8c14f5f7f 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 @@ -3970,15 +3970,18 @@ CREATE TABLE IF NOT EXISTS `tipam_network` ( `network` varchar(100) NOT NULL default '', `name_network` varchar(255) default '', `description` text NOT NULL, - `location` tinytext NOT NULL, + `location` int(10) unsigned NULL, `id_recon_task` int(10) unsigned NOT NULL, `scan_interval` tinyint(2) default 1, `monitoring` tinyint(2) default 0, `id_group` mediumint(8) unsigned NULL default 0, `lightweight_mode` tinyint(2) default 0, `users_operator` text, + `id_site` bigint unsigned, PRIMARY KEY (`id`), - FOREIGN KEY (`id_recon_task`) REFERENCES trecon_task(`id_rt`) ON DELETE CASCADE + FOREIGN KEY (`id_recon_task`) REFERENCES trecon_task(`id_rt`) ON DELETE CASCADE, + FOREIGN KEY (`location`) REFERENCES `tipam_network_location`(`id`) ON DELETE CASCADE, + FOREIGN KEY (`id_site`) REFERENCES `tipam_sites`(`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `tipam_ip` ( @@ -4033,7 +4036,9 @@ CREATE TABLE IF NOT EXISTS `tipam_supernet` ( `address` varchar(250) NOT NULL, `mask` varchar(250) NOT NULL, `subneting_mask` varchar(250) default '', - PRIMARY KEY (`id`) + `id_site` bigint unsigned, + PRIMARY KEY (`id`), + FOREIGN KEY (`id_site`) REFERENCES `tipam_sites`(`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `tipam_supernet_network` ( @@ -4062,9 +4067,6 @@ CREATE TABLE IF NOT EXISTS `tipam_sites` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; INSERT IGNORE INTO `tipam_network_location` (`name`) SELECT `location` FROM `tipam_network` WHERE `location` <> ''; -UPDATE `tipam_network` INNER JOIN `tipam_network_location` ON tipam_network_location.name=tipam_network.location SET tipam_network.location=tipam_network_location.id; -ALTER TABLE `tipam_network` MODIFY `location` int(10) unsigned NULL; -ALTER TABLE `tipam_network` ADD FOREIGN KEY (`location`) REFERENCES `tipam_network_location`(`id`) ON DELETE CASCADE; SET @insert_type = 3; SET @insert_name = 'IPAM Recon'; diff --git a/pandora_console/images/building.png b/pandora_console/images/building.png new file mode 100644 index 0000000000..9083a60215 Binary files /dev/null and b/pandora_console/images/building.png differ diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 48c7c4a6d2..5a91e0b8bc 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -3986,9 +3986,11 @@ CREATE TABLE IF NOT EXISTS `tipam_network` ( `id_group` mediumint(8) unsigned NULL default 0, `lightweight_mode` tinyint(2) default 0, `users_operator` text, + `id_site` bigint unsigned, PRIMARY KEY (`id`), FOREIGN KEY (`id_recon_task`) REFERENCES trecon_task(`id_rt`) ON DELETE CASCADE, - FOREIGN KEY (`location`) REFERENCES `tipam_network_location`(`id`) ON DELETE CASCADE + FOREIGN KEY (`location`) REFERENCES `tipam_network_location`(`id`) ON DELETE CASCADE, + FOREIGN KEY (`id_site`) REFERENCES `tipam_sites`(`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------------------------------------------------- @@ -4055,7 +4057,9 @@ CREATE TABLE IF NOT EXISTS `tipam_supernet` ( `address` varchar(250) NOT NULL, `mask` varchar(250) NOT NULL, `subneting_mask` varchar(250) default '', - PRIMARY KEY (`id`) + `id_site` bigint unsigned, + PRIMARY KEY (`id`), + FOREIGN KEY (`id_site`) REFERENCES `tipam_sites`(`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ----------------------------------------------------------------------