-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 06, 2026 at 10:07 AM
-- Server version: 10.4.32-MariaDB
-- PHP Version: 8.2.12

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `iot`
--

-- --------------------------------------------------------

--
-- Table structure for table `evacuation_routes`
--

CREATE TABLE `evacuation_routes` (
  `id` int(11) NOT NULL,
  `building_id` int(11) NOT NULL,
  `floor_id` int(11) NOT NULL,
  `trigger_point_id` int(10) UNSIGNED NOT NULL,
  `exit_point_id` int(10) UNSIGNED NOT NULL,
  `distance` float NOT NULL,
  `created_at` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `evacuation_routes`
--

INSERT INTO `evacuation_routes` (`id`, `building_id`, `floor_id`, `trigger_point_id`, `exit_point_id`, `distance`, `created_at`) VALUES
(1, 6, 2, 1, 7, 9.2452, '2026-08-06 11:10:16'),
(2, 6, 2, 2, 6, 35.3282, '2026-08-06 11:10:16'),
(3, 6, 2, 3, 6, 28.4422, '2026-08-06 11:10:16'),
(4, 6, 2, 4, 6, 15.7411, '2026-08-06 11:10:16'),
(5, 6, 2, 5, 6, 48.1875, '2026-08-06 11:10:16');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `evacuation_routes`
--
ALTER TABLE `evacuation_routes`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uniq_trigger` (`building_id`,`floor_id`,`trigger_point_id`),
  ADD KEY `trigger_point_id` (`trigger_point_id`),
  ADD KEY `exit_point_id` (`exit_point_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `evacuation_routes`
--
ALTER TABLE `evacuation_routes`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `evacuation_routes`
--
ALTER TABLE `evacuation_routes`
  ADD CONSTRAINT `evacuation_routes_ibfk_1` FOREIGN KEY (`trigger_point_id`) REFERENCES `drawing_points` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `evacuation_routes_ibfk_2` FOREIGN KEY (`exit_point_id`) REFERENCES `drawing_points` (`id`) ON DELETE CASCADE;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
