-- --------------------------------------------------------
-- Server OS:                    Win64
-- HeidiSQL Version:             12.1.0.6537
-- --------------------------------------------------------



-- Dumping database structure for mikrotik
CREATE DATABASE IF NOT EXISTS `mikrotik` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `mikrotik`;

-- Dumping structure for table mikrotik.odc
CREATE TABLE IF NOT EXISTS `odc` (
  `id` int NOT NULL AUTO_INCREMENT,
  `odc` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  `pop_id` int DEFAULT NULL,
  `olt_id` int DEFAULT NULL,
  `sfp_id` int DEFAULT NULL,
  `redaman` varchar(100) DEFAULT NULL,
  `last_check` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `pop_id` (`pop_id`),
  KEY `sfp_id` (`sfp_id`),
  KEY `olt_id` (`olt_id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- Dumping data for table mikrotik.odc: ~1 rows (approximately)
REPLACE INTO `odc` (`id`, `odc`, `pop_id`, `olt_id`, `sfp_id`, `redaman`, `last_check`) VALUES
	(7, 'ODC 02', 7, 6, 13, '-13.9dbm', '2024-11-15');

-- Dumping structure for table mikrotik.odp
CREATE TABLE IF NOT EXISTS `odp` (
  `id` int NOT NULL AUTO_INCREMENT,
  `odp` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  `pop_id` int DEFAULT NULL,
  `olt_id` int DEFAULT NULL,
  `sfp_id` int DEFAULT NULL,
  `odc_id` int DEFAULT NULL,
  `redaman` varchar(100) DEFAULT NULL,
  `last_check` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `pop_id` (`pop_id`),
  KEY `odc_id` (`odc_id`),
  KEY `sfp_id` (`sfp_id`),
  KEY `olt_id` (`olt_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- Dumping data for table mikrotik.odp: ~0 rows (approximately)

-- Dumping structure for table mikrotik.olt
CREATE TABLE IF NOT EXISTS `olt` (
  `id` int NOT NULL AUTO_INCREMENT,
  `olt` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  `pop_id` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `pop_id` (`pop_id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- Dumping data for table mikrotik.olt: ~1 rows (approximately)
REPLACE INTO `olt` (`id`, `olt`, `pop_id`) VALUES
	(5, 'OLT 2', 8),
	(6, 'OLT 3', 7),
	(7, 'OLT 1', 10),
	(8, 'OLT 2', 7);

-- Dumping structure for table mikrotik.sfp
CREATE TABLE IF NOT EXISTS `sfp` (
  `id` int NOT NULL AUTO_INCREMENT,
  `sfp` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  `redaman` varchar(255) DEFAULT NULL,
  `pop_id` int NOT NULL,
  `olt_id` int NOT NULL,
  `last_check` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `name_pop` (`pop_id`) USING BTREE,
  KEY `olt_id` (`olt_id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- Dumping data for table mikrotik.sfp: ~2 rows (approximately)
REPLACE INTO `sfp` (`id`, `sfp`, `redaman`, `pop_id`, `olt_id`, `last_check`) VALUES
	(13, 'SFP 01', '-13.9dbm', 7, 8, '2024-11-11'),
	(14, 'SFP 02', '-13.7dbm', 8, 5, '2024-11-14');

