-- phpMyAdmin SQL Dump
-- version 5.2.2
-- https://www.phpmyadmin.net/
--
-- Servidor: localhost:3306
-- Tiempo de generación: 07-02-2026 a las 00:36:31
-- Versión del servidor: 10.6.23-MariaDB-cll-lve
-- Versión de PHP: 8.3.26

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 */;

--
-- Base de datos: `devmaste_buque_pruebas`
--

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

--
-- Estructura de tabla para la tabla `mediciones`
--

CREATE TABLE `mediciones` (
  `id` int(11) NOT NULL,
  `buque_id` varchar(50) DEFAULT 'BUQUE-01',
  `temp1` decimal(5,2) DEFAULT NULL,
  `temp2` decimal(5,2) DEFAULT NULL,
  `temp3` decimal(5,2) DEFAULT NULL,
  `temp4` decimal(5,2) DEFAULT NULL,
  `temp5` decimal(5,2) DEFAULT NULL,
  `temp6` decimal(5,2) DEFAULT NULL,
  `temp7` decimal(5,2) DEFAULT NULL,
  `temp8` decimal(5,2) DEFAULT NULL,
  `temp9` decimal(5,2) DEFAULT NULL,
  `temp10` decimal(5,2) DEFAULT NULL,
  `humedad` decimal(5,2) DEFAULT NULL,
  `presion` decimal(6,2) DEFAULT NULL,
  `fecha` timestamp NOT NULL DEFAULT current_timestamp(),
  `ip` varchar(45) DEFAULT NULL,
  `temp11` decimal(5,2) DEFAULT NULL,
  `temp12` decimal(5,2) DEFAULT NULL,
  `temp13` decimal(5,2) DEFAULT NULL,
  `temp14` decimal(5,2) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Volcado de datos para la tabla `mediciones`
--

INSERT INTO `mediciones` (`id`, `buque_id`, `temp1`, `temp2`, `temp3`, `temp4`, `temp5`, `temp6`, `temp7`, `temp8`, `temp9`, `temp10`, `humedad`, `presion`, `fecha`, `ip`, `temp11`, `temp12`, `temp13`, `temp14`) VALUES
(20821, 'BUQUE-01', NULL, 26.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-02-07 03:32:17', '181.116.45.227', NULL, NULL, NULL, NULL),
(20822, 'BUQUE-01', NULL, 26.00, 25.44, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-02-07 03:32:18', '181.116.45.227', NULL, NULL, NULL, NULL),
(20823, 'BUQUE-01', NULL, 26.00, 25.44, NULL, 26.62, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-02-07 03:32:20', '181.116.45.227', NULL, NULL, NULL, NULL),
(20824, 'BUQUE-01', NULL, 26.00, 25.44, NULL, 26.62, NULL, NULL, NULL, 25.62, NULL, NULL, NULL, '2026-02-07 03:32:21', '181.116.45.227', NULL, NULL, NULL, NULL),
(20825, 'BUQUE-01', NULL, 26.00, 25.44, NULL, 26.62, NULL, NULL, NULL, 25.62, NULL, NULL, NULL, '2026-02-07 03:32:22', '181.116.45.227', 25.88, NULL, NULL, NULL),
(20826, 'BUQUE-01', NULL, 25.94, 25.44, NULL, 26.62, NULL, NULL, NULL, 25.62, NULL, NULL, NULL, '2026-02-07 03:33:14', '181.116.45.227', 25.88, NULL, NULL, NULL),
(20827, 'BUQUE-01', NULL, 25.94, 25.44, NULL, 26.62, NULL, NULL, NULL, 25.62, NULL, NULL, NULL, '2026-02-07 03:33:16', '181.116.45.227', 25.88, NULL, NULL, NULL),
(20828, 'BUQUE-01', NULL, 25.94, 25.44, NULL, 26.62, NULL, NULL, NULL, 25.62, NULL, NULL, NULL, '2026-02-07 03:33:17', '181.116.45.227', 25.88, NULL, NULL, NULL),
(20829, 'BUQUE-01', NULL, 25.94, 25.44, NULL, 26.62, NULL, NULL, NULL, 25.62, NULL, NULL, NULL, '2026-02-07 03:33:18', '181.116.45.227', 25.88, NULL, NULL, NULL),
(20830, 'BUQUE-01', NULL, 25.94, 25.44, NULL, 26.62, NULL, NULL, NULL, 25.62, NULL, NULL, NULL, '2026-02-07 03:33:19', '181.116.45.227', 25.94, NULL, NULL, NULL),
(20831, 'BUQUE-01', NULL, 25.94, 25.44, NULL, 26.62, NULL, NULL, NULL, 25.62, NULL, NULL, NULL, '2026-02-07 03:34:12', '181.116.45.227', 25.94, NULL, NULL, NULL),
(20832, 'BUQUE-01', NULL, 25.94, 25.44, NULL, 26.62, NULL, NULL, NULL, 25.62, NULL, NULL, NULL, '2026-02-07 03:34:13', '181.116.45.227', 25.94, NULL, NULL, NULL),
(20833, 'BUQUE-01', NULL, 25.94, 25.44, NULL, 26.62, NULL, NULL, NULL, 25.62, NULL, NULL, NULL, '2026-02-07 03:34:14', '181.116.45.227', 25.94, NULL, NULL, NULL),
(20834, 'BUQUE-01', NULL, 25.94, 25.44, NULL, 26.62, NULL, NULL, NULL, 25.62, NULL, NULL, NULL, '2026-02-07 03:34:15', '181.116.45.227', 25.94, NULL, NULL, NULL),
(20835, 'BUQUE-01', NULL, 25.94, 25.44, NULL, 26.62, NULL, NULL, NULL, 25.62, NULL, NULL, NULL, '2026-02-07 03:34:16', '181.116.45.227', 25.94, NULL, NULL, NULL),
(20836, 'BUQUE-01', NULL, 25.94, 25.44, NULL, 26.62, NULL, NULL, NULL, 25.62, NULL, NULL, NULL, '2026-02-07 03:35:08', '181.116.45.227', 25.94, NULL, NULL, NULL),
(20837, 'BUQUE-01', NULL, 25.94, 25.50, NULL, 26.62, NULL, NULL, NULL, 25.62, NULL, NULL, NULL, '2026-02-07 03:35:09', '181.116.45.227', 25.94, NULL, NULL, NULL),
(20838, 'BUQUE-01', NULL, 25.94, 25.50, NULL, 26.62, NULL, NULL, NULL, 25.62, NULL, NULL, NULL, '2026-02-07 03:35:11', '181.116.45.227', 25.94, NULL, NULL, NULL),
(20839, 'BUQUE-01', NULL, 25.94, 25.50, NULL, 26.62, NULL, NULL, NULL, 25.62, NULL, NULL, NULL, '2026-02-07 03:35:12', '181.116.45.227', 25.94, NULL, NULL, NULL),
(20840, 'BUQUE-01', NULL, 25.94, 25.50, NULL, 26.62, NULL, NULL, NULL, 25.62, NULL, NULL, NULL, '2026-02-07 03:35:13', '181.116.45.227', 25.94, NULL, NULL, NULL),
(20841, 'BUQUE-01', NULL, 26.00, 25.50, NULL, 26.62, NULL, NULL, NULL, 25.62, NULL, NULL, NULL, '2026-02-07 03:36:05', '181.116.45.227', 25.94, NULL, NULL, NULL),
(20842, 'BUQUE-01', NULL, 26.00, 25.50, NULL, 26.62, NULL, NULL, NULL, 25.62, NULL, NULL, NULL, '2026-02-07 03:36:07', '181.116.45.227', 25.94, NULL, NULL, NULL),
(20843, 'BUQUE-01', NULL, 26.00, 25.50, NULL, 26.69, NULL, NULL, NULL, 25.62, NULL, NULL, NULL, '2026-02-07 03:36:08', '181.116.45.227', 25.94, NULL, NULL, NULL),
(20844, 'BUQUE-01', NULL, 26.00, 25.50, NULL, 26.69, NULL, NULL, NULL, 25.69, NULL, NULL, NULL, '2026-02-07 03:36:09', '181.116.45.227', 25.94, NULL, NULL, NULL),
(20845, 'BUQUE-01', NULL, 26.00, 25.50, NULL, 26.69, NULL, NULL, NULL, 25.69, NULL, NULL, NULL, '2026-02-07 03:36:10', '181.116.45.227', 25.94, NULL, NULL, NULL);

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

--
-- Estructura de tabla para la tabla `mensajes_prueba`
--

CREATE TABLE `mensajes_prueba` (
  `id` int(11) NOT NULL,
  `mensaje` text NOT NULL,
  `fecha` timestamp NOT NULL DEFAULT current_timestamp(),
  `ip` varchar(45) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Estructura de tabla para la tabla `sensor_positions`
--

CREATE TABLE `sensor_positions` (
  `id` int(11) NOT NULL,
  `buque_id` varchar(50) DEFAULT 'BUQUE-01',
  `sensor_id` int(11) NOT NULL,
  `label` varchar(255) DEFAULT NULL,
  `x` varchar(20) NOT NULL,
  `y_top` varchar(20) NOT NULL,
  `y_side` varchar(20) NOT NULL,
  `fecha_actualizacion` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `sensor_positions`
--

INSERT INTO `sensor_positions` (`id`, `buque_id`, `sensor_id`, `label`, `x`, `y_top`, `y_side`, `fecha_actualizacion`) VALUES
(1, 'BUQUE-01', 1, 'Tunel 1', '10%', '30%', '76%', '2026-02-05 13:13:14'),
(2, 'BUQUE-01', 2, 'Tunel 2', '16%', '30%', '76%', '2026-02-05 13:13:14'),
(3, 'BUQUE-01', 3, 'Tunel 3', '22%', '30%', '76%', '2026-02-05 13:13:14'),
(4, 'BUQUE-01', 4, 'Tunel 4', '28%', '30%', '76%', '2026-02-05 13:13:14'),
(5, 'BUQUE-01', 5, 'Tunel 5', '34%', '30%', '76%', '2026-02-05 13:13:14'),
(6, 'BUQUE-01', 6, 'B. Entre P. 1', '40%', '30%', '76%', '2026-02-05 13:13:14'),
(559, 'BUQUE-01', 7, 'B. Entre P. 2', '46%', '30%', '76%', '2026-02-05 13:13:14'),
(579, 'BUQUE-01', 8, 'Bodega 1', '52%', '30%', '76%', '2026-02-05 13:13:14'),
(580, 'BUQUE-01', 9, 'Bodega 2', '58%', '30%', '76%', '2026-02-05 13:13:14'),
(581, 'BUQUE-01', 10, 'Bodega 3', '64%', '30%', '76%', '2026-02-05 13:13:14'),
(582, 'BUQUE-01', 11, 'Bodega 4', '70%', '30%', '76%', '2026-02-05 13:13:14'),
(583, 'BUQUE-01', 12, 'Bodega 5', '76%', '30%', '76%', '2026-02-05 13:13:14'),
(584, 'BUQUE-01', 13, 'Bodega 6', '82%', '30%', '76%', '2026-02-05 13:13:14'),
(585, 'BUQUE-01', 14, 'Bodega 7', '88%', '30%', '76%', '2026-02-05 13:13:14');

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

--
-- Estructura de tabla para la tabla `users`
--

CREATE TABLE `users` (
  `id` int(11) NOT NULL,
  `username` varchar(50) NOT NULL,
  `password` varchar(255) NOT NULL,
  `role` enum('admin','user') DEFAULT 'user',
  `status` enum('pending','active','rejected') DEFAULT 'pending',
  `created_at` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Volcado de datos para la tabla `users`
--

INSERT INTO `users` (`id`, `username`, `password`, `role`, `status`, `created_at`) VALUES
(1, 'admin', '$2y$10$aPR9F.R/zTDCFwfOfnaY7.287OMezgeuhyTfbjSjaGLLfUx1asUtK', 'admin', 'active', '2026-02-05 12:45:40'),
(2, 'Jonathan', '$2y$10$SSl0XNdkMzp43c0Fr7Iko.PDCBWon6yt521kG5KyfWEcQCR8oJRCi', 'user', 'active', '2026-02-05 13:27:55');

--
-- Índices para tablas volcadas
--

--
-- Indices de la tabla `mediciones`
--
ALTER TABLE `mediciones`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_buque` (`buque_id`),
  ADD KEY `idx_fecha` (`fecha`);

--
-- Indices de la tabla `mensajes_prueba`
--
ALTER TABLE `mensajes_prueba`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_fecha` (`fecha`);

--
-- Indices de la tabla `sensor_positions`
--
ALTER TABLE `sensor_positions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_sensor` (`buque_id`,`sensor_id`),
  ADD KEY `idx_buque` (`buque_id`),
  ADD KEY `idx_fecha` (`fecha_actualizacion`);

--
-- Indices de la tabla `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `username` (`username`);

--
-- AUTO_INCREMENT de las tablas volcadas
--

--
-- AUTO_INCREMENT de la tabla `mediciones`
--
ALTER TABLE `mediciones`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20846;

--
-- AUTO_INCREMENT de la tabla `mensajes_prueba`
--
ALTER TABLE `mensajes_prueba`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `sensor_positions`
--
ALTER TABLE `sensor_positions`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1986;

--
-- AUTO_INCREMENT de la tabla `users`
--
ALTER TABLE `users`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
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 */;
