-- https://www.phpmyadmin.net/
--
-- Servidor: localhost:3306
-- Tiempo de generación: 24-07-2026 a las 11:15:08
-- Versión del servidor: 10.11.18-MariaDB
-- Versión de PHP: 8.4.22

START TRANSACTION;



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

--
-- Estructura de tabla para la tabla `configuracion`
--

CREATE TABLE `configuracion` (
  `id` int(11) NOT NULL,
  `clave` varchar(100) NOT NULL,
  `valor` text DEFAULT NULL,
  `tipo` varchar(30) DEFAULT 'text',
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `configuracion` (`id`, `clave`, `valor`, `tipo`, `updated_at`) VALUES
(1, 'nombre_evento', '', 'text', '2026-07-21 20:44:37'),
(2, 'mensaje_espera', 'Esperando el próximo sorteo', 'text', '2026-07-21 20:37:41'),
(3, 'texto_ganador', 'GANADOR', 'text', '2026-07-21 20:37:41'),
(4, 'logo_principal', 'uploads/logos/153f0d185acfbba6.png', 'image', '2026-07-23 17:22:08'),
(5, 'logo_secundario', 'uploads/logos/e3bf6c04897d8a6e.png', 'image', '2026-07-21 20:40:00'),
(6, 'fondo_imagen', '', 'image', '2026-07-21 20:37:41'),
(7, 'fondo_video', 'uploads/fondos/8330eeb670a714cf.mp4', 'video', '2026-07-21 21:28:52'),
(8, 'fondo_video_activo', '1', 'bool', '2026-07-21 20:44:21'),
(9, 'fondo_opacidad', '55', 'number', '2026-07-21 20:37:41'),
(10, 'fondo_video_loop', '1', 'bool', '2026-07-21 20:37:41'),
(11, 'color_primario', '#ff2fd0', 'text', '2026-07-21 20:40:00'),
(12, 'color_secundario', '#00e6ff', 'text', '2026-07-21 20:40:00'),
(13, 'sonidos_activos', '0', 'bool', '2026-07-21 20:49:39'),
(14, 'sonido_inicio', '', 'audio', '2026-07-21 20:37:41'),
(15, 'sonido_girando', '', 'audio', '2026-07-21 20:37:41'),
(16, 'sonido_ganador', '', 'audio', '2026-07-21 20:37:41'),
(17, 'duracion_frenado', '5', 'number', '2026-07-21 20:37:41'),
(18, 'confeti_activo', '1', 'bool', '2026-07-21 20:37:41'),
(19, 'pantalla_completa', '1', 'bool', '2026-07-21 20:37:41'),
(20, 'zona_horaria', 'America/Santiago', 'text', '2026-07-21 20:37:41'),
(21, 'formato_fecha', 'd/m/Y H:i', 'text', '2026-07-21 20:37:41'),
(22, 'campos_ganador', '', 'text', '2026-07-21 20:49:39'),
(23, 'clave_control', '', 'text', '2026-07-21 20:37:41'),
(91, 'galeria_logo', '', 'image', '2026-07-21 23:23:45'),
(92, 'galeria_mensaje_espera', 'Esperando fotografías', 'text', '2026-07-21 21:21:12'),
(93, 'galeria_tiempo_foto', '6', 'number', '2026-07-21 21:21:12'),
(94, 'galeria_duracion_transicion', '1000', 'number', '2026-07-21 21:21:12'),
(95, 'galeria_transicion', 'random', 'text', '2026-07-21 21:37:34'),
(96, 'galeria_ajuste', 'contain', 'text', '2026-07-21 23:23:17'),
(97, 'galeria_fondo', 'desenfoque', 'text', '2026-07-21 21:21:12'),
(98, 'galeria_orden', 'aleatorio', 'text', '2026-07-21 21:37:34'),
(99, 'galeria_bucle', '1', 'bool', '2026-07-21 21:21:12'),
(100, 'galeria_mostrar_logo', '1', 'bool', '2026-07-21 21:21:12'),
(101, 'galeria_mostrar_contador', '0', 'bool', '2026-07-21 21:21:12'),
(102, 'galeria_mostrar_fecha', '0', 'bool', '2026-07-21 21:21:12'),
(103, 'galeria_intervalo_check', '5000', 'number', '2026-07-21 21:21:12'),
(104, 'galeria_version', '32', 'number', '2026-07-24 14:52:27');

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

--
-- Estructura de tabla para la tabla `galeria_fotos`
--

CREATE TABLE `galeria_fotos` (
  `id` int(11) NOT NULL,
  `archivo` varchar(255) NOT NULL,
  `miniatura` varchar(255) DEFAULT NULL,
  `nombre_original` varchar(255) DEFAULT NULL,
  `ancho` int(11) DEFAULT NULL,
  `alto` int(11) DEFAULT NULL,
  `orden` int(11) NOT NULL DEFAULT 0,
  `activo` tinyint(1) NOT NULL DEFAULT 1,
  `uploaded_by` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `galeria_fotos` (`id`, `archivo`, `miniatura`, `nombre_original`, `ancho`, `alto`, `orden`, `activo`, `uploaded_by`, `created_at`) VALUES
(17, 'uploads/galeria/7f9d8efa0d353b33.jpg', 'uploads/galeria/thumbs/7f9d8efa0d353b33.jpg', '01.png', 1672, 941, 1, 1, 1, '2026-07-24 14:52:27');

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

--
-- Estructura de tabla para la tabla `import_batches`
--

CREATE TABLE `import_batches` (
  `id` int(11) NOT NULL,
  `filename` varchar(255) DEFAULT NULL,
  `total_rows` int(11) DEFAULT 0,
  `imported_rows` int(11) DEFAULT 0,
  `omitted_rows` int(11) DEFAULT 0,
  `error_rows` int(11) DEFAULT 0,
  `imported_by` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `import_batches` (`id`, `filename`, `total_rows`, `imported_rows`, `omitted_rows`, `error_rows`, `imported_by`, `created_at`) VALUES
(1, 'Listado  Asistentes aniversario.xlsx', 138, 136, 1, 0, 1, '2026-07-21 20:40:41');

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

--
-- Estructura de tabla para la tabla `logs_actividad`
--

CREATE TABLE `logs_actividad` (
  `id` int(11) NOT NULL,
  `accion` varchar(100) NOT NULL,
  `descripcion` text DEFAULT NULL,
  `ip_usuario` varchar(45) DEFAULT NULL,
  `fecha` timestamp NOT NULL DEFAULT current_timestamp(),
  `admin_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

INSERT INTO `logs_actividad` (`id`, `accion`, `descripcion`, `ip_usuario`, `fecha`, `admin_id`) VALUES
(118, 'LOGIN', 'Inicio de sesión exitoso', '181.42.51.84', '2025-07-25 21:47:40', 1),
(119, 'SORTEO_REALIZADO', 'Sorteo: Papàs - Ganador: Fernanda Ríos', '200.104.77.221', '2025-07-25 21:50:00', 1),
(120, 'SORTEO_REALIZADO', 'Sorteo: CAFETERA - Ganador: Mauricio Uribe', '181.42.51.84', '2025-07-25 22:16:44', 1),
(121, 'LOGIN', 'Inicio de sesión exitoso', '200.104.77.221', '2025-07-25 23:47:25', 1),
(122, 'LOGIN', 'Inicio de sesión exitoso', '200.104.77.221', '2025-09-25 21:05:41', 1),
(123, 'LOGIN', 'Inicio de sesión exitoso', '181.74.128.117', '2026-07-21 19:20:37', 1),
(124, 'SORTEO_REALIZADO', 'Sorteo: Smart TV 55 pulgadas - Ganador: Carla Sanhueza', '181.74.128.117', '2026-07-21 19:22:24', 1),
(125, 'SORTEO_REALIZADO', 'Sorteo: Cafetera - Ganador: Johannymar Barrios', '181.74.128.117', '2026-07-21 19:55:10', 1),
(126, 'CARGAR_EXCEL', 'Usuarios cargados: 119 insertados, 18 duplicados, 0 errores', '181.74.128.117', '2026-07-21 20:00:27', 1),
(127, 'SORTEO_REALIZADO', 'Sorteo: iPhone 15 - Ganador: 123', '181.74.128.117', '2026-07-21 20:00:40', 1),
(128, 'LOGOUT', 'Cierre de sesión', '181.74.128.117', '2026-07-21 20:38:16', 1),
(129, 'LOGIN', 'Inicio de sesión exitoso', '181.74.128.117', '2026-07-21 20:38:36', 1),
(130, 'CONFIG_ACTUALIZAR', 'Configuración general actualizada', '181.74.128.117', '2026-07-21 20:40:00', 1),
(131, 'IMPORTAR_PARTICIPANTES', 'Lote #1: 136 insertados, 1 duplicados, 0 errores', '181.74.128.117', '2026-07-21 20:40:41', 1),
(132, 'SORTEO_CREAR', 'Sorteo #1: iPhone 15', '181.74.128.117', '2026-07-21 20:41:31', 1),
(133, 'SORTEO_INICIAR', 'Sorteo #1 (iPhone 15)', '181.74.128.117', '2026-07-21 20:41:34', 1),
(134, 'SORTEO_REALIZADO', 'Sorteo: iPhone 15 - Ganador: Ivette Erna', '181.74.128.117', '2026-07-21 20:41:46', 1),
(135, 'CONFIG_ACTUALIZAR', 'Configuración general actualizada', '181.74.128.117', '2026-07-21 20:44:21', 1),
(136, 'CONFIG_ACTUALIZAR', 'Configuración general actualizada', '181.74.128.117', '2026-07-21 20:44:37', 1),
(137, 'SORTEO_OCULTAR', 'Sorteo #1: se dejó de mostrar al ganador', '181.74.128.117', '2026-07-21 20:45:38', 1),
(138, 'LOGIN', 'Inicio de sesión exitoso', '181.74.128.117', '2026-07-21 20:48:43', 1),
(139, 'CONFIG_ACTUALIZAR', 'Configuración general actualizada', '181.74.128.117', '2026-07-21 20:49:39', 1),
(140, 'SORTEO_INICIAR', 'Sorteo #1 (iPhone 15)', '181.74.128.117', '2026-07-21 20:49:50', 1),
(141, 'SORTEO_REALIZADO', 'Sorteo: iPhone 15 - Ganador: Juan Cristian', '181.74.128.117', '2026-07-21 20:50:04', 1),
(142, 'SORTEO_OCULTAR', 'Sorteo #1: se dejó de mostrar al ganador', '181.74.128.117', '2026-07-21 20:50:20', 1),
(143, 'SORTEO_INICIAR', 'Sorteo #1 (iPhone 15)', '181.74.128.117', '2026-07-21 20:51:18', 1),
(144, 'SORTEO_REALIZADO', 'Sorteo: iPhone 15 - Ganador: Tarek', '181.74.128.117', '2026-07-21 20:51:23', 1),
(145, 'SORTEO_OCULTAR', 'Sorteo #1: se dejó de mostrar al ganador', '181.74.128.117', '2026-07-21 20:52:58', 1),
(146, 'SORTEO_INICIAR', 'Sorteo #1 (iPhone 15)', '181.74.128.117', '2026-07-21 20:54:14', 1),
(147, 'SORTEO_REALIZADO', 'Sorteo: iPhone 15 - Ganador: Javier Andres', '181.74.128.117', '2026-07-21 20:54:31', 1),
(148, 'SORTEO_OCULTAR', 'Sorteo #1: se dejó de mostrar al ganador', '181.74.128.117', '2026-07-21 20:57:00', 1),
(149, 'SORTEO_CREAR', 'Sorteo #2: Smart TV 55 pulgadas', '181.74.128.117', '2026-07-21 20:58:00', 1),
(150, 'SORTEO_INICIAR', 'Sorteo #2 (Smart TV 55 pulgadas)', '181.74.128.117', '2026-07-21 20:58:03', 1),
(151, 'GALERIA_SUBIR', 'Fotos subidas: 4, con error: 0', '181.74.128.117', '2026-07-21 21:21:45', 1),
(152, 'RONDA_CANCELAR', 'Ronda #0 cancelada (la sesión continúa)', '181.74.128.117', '2026-07-21 21:22:28', 1),
(153, 'SORTEO_CREAR', 'Sesión de sorteo #3: Fiesta Anual 2026', '181.74.128.117', '2026-07-21 21:22:44', 1),
(154, 'RONDA_INICIAR', 'Sorteo #3 · premio: TV (ronda #1)', '181.74.128.117', '2026-07-21 21:22:57', 1),
(155, 'SORTEO_REALIZADO', 'Premio: TV - Ganador: Romina Andrea', '181.74.128.117', '2026-07-21 21:23:04', 1),
(156, 'RONDA_OCULTAR', 'Ronda #1: se dejó de mostrar al ganador', '181.74.128.117', '2026-07-21 21:23:13', 1),
(157, 'RONDA_INICIAR', 'Sorteo #3 · premio: Celular (ronda #2)', '181.74.128.117', '2026-07-21 21:23:21', 1),
(158, 'SORTEO_REALIZADO', 'Premio: Celular - Ganador: Marisol Pilar', '181.74.128.117', '2026-07-21 21:23:28', 1),
(159, 'CONFIG_ACTUALIZAR', 'Configuración general actualizada', '181.74.128.117', '2026-07-21 21:24:00', 1),
(160, 'RONDA_OCULTAR', 'Ronda #2: se dejó de mostrar al ganador', '181.74.128.117', '2026-07-21 21:24:23', 1),
(161, 'GALERIA_SUBIR', 'Fotos subidas: 1, con error: 0', '181.74.128.117', '2026-07-21 21:25:00', 1),
(162, 'CONFIG_ACTUALIZAR', 'Configuración general actualizada', '181.74.128.117', '2026-07-21 21:28:52', 1),
(163, 'CONFIG_ACTUALIZAR', 'Configuración general actualizada', '181.74.128.117', '2026-07-21 21:31:24', 1),
(164, 'CONFIG_ACTUALIZAR', 'Configuración general actualizada', '181.74.128.117', '2026-07-21 21:32:42', 1),
(165, 'CONFIG_ACTUALIZAR', 'Configuración general actualizada', '181.74.128.117', '2026-07-21 21:36:57', 1),
(166, 'CONFIG_ACTUALIZAR', 'Configuración general actualizada', '181.74.128.117', '2026-07-21 21:37:34', 1),
(167, 'GALERIA_ELIMINAR', 'Foto #1 eliminada', '181.74.128.117', '2026-07-21 21:56:48', 1),
(168, 'GALERIA_ELIMINAR', 'Foto #2 eliminada', '181.74.128.117', '2026-07-21 21:56:49', 1),
(169, 'GALERIA_ELIMINAR', 'Foto #3 eliminada', '181.74.128.117', '2026-07-21 21:56:51', 1),
(170, 'GALERIA_ELIMINAR', 'Foto #4 eliminada', '181.74.128.117', '2026-07-21 21:56:51', 1),
(171, 'GALERIA_ELIMINAR', 'Foto #5 eliminada', '181.74.128.117', '2026-07-21 21:56:52', 1),
(172, 'GALERIA_SUBIR', 'Fotos subidas: 5, con error: 0', '181.74.128.117', '2026-07-21 21:57:06', 1),
(173, 'CONFIG_ACTUALIZAR', 'Configuración general actualizada', '181.74.128.117', '2026-07-21 23:23:17', 1),
(174, 'CONFIG_ACTUALIZAR', 'Configuración general actualizada', '181.74.128.117', '2026-07-21 23:23:45', 1),
(175, 'LOGIN', 'Inicio de sesión exitoso', '181.74.128.117', '2026-07-23 00:39:53', 1),
(176, 'LOGIN', 'Inicio de sesión exitoso', '181.74.128.117', '2026-07-23 16:58:02', 1),
(177, 'VOTACION_ELIMINAR', 'Votación #1 eliminada', '181.74.128.117', '2026-07-23 17:21:07', 1),
(178, 'GALERIA_ELIMINAR', 'Foto #6 eliminada', '181.74.128.117', '2026-07-23 17:21:26', 1),
(179, 'GALERIA_ELIMINAR', 'Foto #8 eliminada', '181.74.128.117', '2026-07-23 17:21:27', 1),
(180, 'GALERIA_ELIMINAR', 'Foto #7 eliminada', '181.74.128.117', '2026-07-23 17:21:28', 1),
(181, 'GALERIA_ELIMINAR', 'Foto #9 eliminada', '181.74.128.117', '2026-07-23 17:21:30', 1),
(182, 'GALERIA_ELIMINAR', 'Foto #10 eliminada', '181.74.128.117', '2026-07-23 17:21:31', 1),
(183, 'CONFIG_ACTUALIZAR', 'Configuración general actualizada', '181.74.128.117', '2026-07-23 17:22:08', 1),
(184, 'LOGIN', 'Inicio de sesión exitoso', '181.74.128.117', '2026-07-23 23:11:53', 1),
(185, 'PARTICIPANTE_CREAR', 'Participante creado: Gabriel Lafertte Cárcamo', '181.74.128.117', '2026-07-23 23:12:50', 1),
(186, 'LOGIN', 'Inicio de sesión exitoso', '181.74.128.117', '2026-07-24 04:14:07', 1),
(187, 'LOGIN', 'Inicio de sesión exitoso', '186.175.20.192', '2026-07-24 13:45:44', 1),
(188, 'GALERIA_SUBIR', 'Fotos subidas: 6, con error: 0', '186.175.20.192', '2026-07-24 14:18:46', 1),
(189, 'GALERIA_ELIMINAR', 'Foto #11 eliminada', '186.175.20.192', '2026-07-24 14:52:06', 1),
(190, 'GALERIA_ELIMINAR', 'Foto #12 eliminada', '186.175.20.192', '2026-07-24 14:52:07', 1),
(191, 'GALERIA_ELIMINAR', 'Foto #13 eliminada', '186.175.20.192', '2026-07-24 14:52:09', 1),
(192, 'GALERIA_ELIMINAR', 'Foto #14 eliminada', '186.175.20.192', '2026-07-24 14:52:10', 1),
(193, 'GALERIA_ELIMINAR', 'Foto #15 eliminada', '186.175.20.192', '2026-07-24 14:52:11', 1),
(194, 'GALERIA_ELIMINAR', 'Foto #16 eliminada', '186.175.20.192', '2026-07-24 14:52:13', 1),
(195, 'GALERIA_SUBIR', 'Fotos subidas: 1, con error: 0', '186.175.20.192', '2026-07-24 14:52:27', 1),
(196, 'SORTEO_CREAR', 'Sesión de sorteo #4: Fiesta Anual', '186.175.20.192', '2026-07-24 14:58:01', 1),
(197, 'RONDA_INICIAR', 'Sorteo #4 · premio: Cerlular (ronda #3)', '186.175.20.192', '2026-07-24 15:06:51', 1),
(198, 'SORTEO_REALIZADO', 'Premio: Cerlular - Ganador: Barbara Mayeli', '186.175.20.192', '2026-07-24 15:07:01', 1);

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

--
-- Estructura de tabla para la tabla `participantes`
--

CREATE TABLE `participantes` (
  `id` int(11) NOT NULL,
  `nombre` varchar(255) NOT NULL,
  `identificador` varchar(100) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `telefono` varchar(50) DEFAULT NULL,
  `empresa` varchar(255) DEFAULT NULL,
  `cargo` varchar(255) DEFAULT NULL,
  `numero_participante` varchar(50) DEFAULT NULL,
  `datos_adicionales` text DEFAULT NULL,
  `estado` enum('disponible','ganador','inactivo') NOT NULL DEFAULT 'disponible',
  `ha_ganado` tinyint(1) NOT NULL DEFAULT 0,
  `import_batch_id` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `participantes` (`id`, `nombre`, `identificador`, `email`, `telefono`, `empresa`, `cargo`, `numero_participante`, `datos_adicionales`, `estado`, `ha_ganado`, `import_batch_id`, `created_at`, `updated_at`) VALUES
(1, 'Alicia Cristina', '', '', '', '', '', '1', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(2, 'Miguel Ignacio', '', '', '', '', '', '2', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(3, 'Macarena Fernanda', '', '', '', '', '', '3', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(4, 'María del Pilar', '', '', '', '', '', '4', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(5, 'Víctor Gabriel', '', '', '', '', '', '5', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(6, 'Verónica Andrea', '', '', '', '', '', '6', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(7, 'Yanira del Carmen', '', '', '', '', '', '7', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(8, 'Bayron Alejandro', '', '', '', '', '', '8', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(9, 'Johannymar Nazareth', '', '', '', '', '', '9', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(10, 'Marisol Pilar', '', '', '', '', '', '10', NULL, 'ganador', 1, 1, '2026-07-21 20:40:41', '2026-07-21 21:23:28'),
(11, 'Antonio Francisco', '', '', '', '', '', '11', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(12, 'Daniel Ignacio', '', '', '', '', '', '12', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(13, 'Claudia Erna', '', '', '', '', '', '13', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(14, 'Francesco Alexander', '', '', '', '', '', '14', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(15, 'María José', '', '', '', '', '', '15', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(16, 'Romina Salome', '', '', '', '', '', '16', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(17, 'Valerie Andrea', '', '', '', '', '', '17', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(18, 'Jorge Antonio', '', '', '', '', '', '18', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(19, 'Ana Isabel', '', '', '', '', '', '19', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(20, 'Josefa Andrea', '', '', '', '', '', '20', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(21, 'Romina Andrea', '', '', '', '', '', '21', NULL, 'ganador', 1, 1, '2026-07-21 20:40:41', '2026-07-21 21:23:04'),
(22, 'Ariel Andres', '', '', '', '', '', '22', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(23, 'Franchesca Andrea', '', '', '', '', '', '23', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(24, 'Rocío Estrella', '', '', '', '', '', '24', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(25, 'Lorena Ángelica', '', '', '', '', '', '25', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(26, 'Elizabeth Viviana', '', '', '', '', '', '26', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(27, 'Rosario Andrea', '', '', '', '', '', '27', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(28, 'Ornella Karime', '', '', '', '', '', '28', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(29, 'Lissette', '', '', '', '', '', '29', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(30, 'Barbara Gabriela', '', '', '', '', '', '30', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(31, 'Alejandra Carolina', '', '', '', '', '', '31', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(32, 'Barbara Isidora', '', '', '', '', '', '32', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(33, 'Ivette Erna', '', '', '', '', '', '33', NULL, 'ganador', 1, 1, '2026-07-21 20:40:41', '2026-07-21 20:41:46'),
(34, 'Noelia Naomi', '', '', '', '', '', '34', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(35, 'María Eugenia', '', '', '', '', '', '35', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(36, 'Patricia Ángelica', '', '', '', '', '', '36', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(37, 'Karla Patricia', '', '', '', '', '', '37', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(38, 'Giannina Fabiola', '', '', '', '', '', '38', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(39, 'Marianela Catalina', '', '', '', '', '', '39', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(40, 'Valeria Katerina', '', '', '', '', '', '40', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(41, 'Camila Constanza', '', '', '', '', '', '41', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(42, 'Amalia Yaneska', '', '', '', '', '', '42', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(43, 'Karin Valeria', '', '', '', '', '', '43', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(44, 'Francisco Andres', '', '', '', '', '', '44', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(45, 'Francisca Arrau', '', '', '', '', '', '45', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(46, 'Javier Andres', '', '', '', '', '', '46', NULL, 'ganador', 1, 1, '2026-07-21 20:40:41', '2026-07-21 20:54:31'),
(47, 'Fabiola Alejandra', '', '', '', '', '', '47', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(48, 'Joyce Vanessa', '', '', '', '', '', '48', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(49, 'Javiera Francisca', '', '', '', '', '', '49', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(50, 'Claudio Andres', '', '', '', '', '', '50', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(51, 'Nancy Ximena', '', '', '', '', '', '51', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(52, 'Kevin Ignacio', '', '', '', '', '', '52', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(53, 'Daniela Alejandra', '', '', '', '', '', '53', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(54, 'Leonardo Sebastían', '', '', '', '', '', '54', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(55, 'Barbara', '', '', '', '', '', '55', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(56, 'Juan Cristian', '', '', '', '', '', '56', NULL, 'ganador', 1, 1, '2026-07-21 20:40:41', '2026-07-21 20:50:04'),
(57, 'Yessenia Andrea', '', '', '', '', '', '57', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(58, 'Karina Alejandra', '', '', '', '', '', '58', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(59, 'Nicole Marisol', '', '', '', '', '', '59', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(60, 'Leonardo Ivan', '', '', '', '', '', '60', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(61, 'Barbara Elizabeth', '', '', '', '', '', '61', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(62, 'Marietta Angelina', '', '', '', '', '', '62', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(63, 'Olga', '', '', '', '', '', '63', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(64, 'Pablo Andres', '', '', '', '', '', '64', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(65, 'Miguel Andres', '', '', '', '', '', '65', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(66, 'Camila Nicole', '', '', '', '', '', '66', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(67, 'Francisca Belen', '', '', '', '', '', '67', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(68, 'Natalia Isabel', '', '', '', '', '', '68', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(69, 'Hans Mirko', '', '', '', '', '', '69', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(70, 'Jocelyn Alejandra', '', '', '', '', '', '70', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(71, 'Julio Hernan', '', '', '', '', '', '71', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(72, 'Marcela Andrea', '', '', '', '', '', '72', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(73, 'David Alfredo', '', '', '', '', '', '73', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(74, 'Luis Marcelo', '', '', '', '', '', '74', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(75, 'Rodrigo Andres', '', '', '', '', '', '75', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(76, 'Ximena Beatriz', '', '', '', '', '', '76', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(77, 'Felipe Alejandro', '', '', '', '', '', '77', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(78, 'Luciana Jimena', '', '', '', '', '', '78', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(79, 'Gricel Andrea', '', '', '', '', '', '79', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(80, 'Francisca Valentina', '', '', '', '', '', '80', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(81, 'Daniela Susana', '', '', '', '', '', '81', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(82, 'Camila Estrella', '', '', '', '', '', '82', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(83, 'Claudia Ximena', '', '', '', '', '', '83', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(84, 'María Julieta', '', '', '', '', '', '84', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(85, 'Matias Andres', '', '', '', '', '', '85', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(86, 'Makarena Constanza', '', '', '', '', '', '86', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(87, 'Cecilia Angelina', '', '', '', '', '', '87', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(88, 'Erika Edith', '', '', '', '', '', '88', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(89, 'Carolina Alejandra', '', '', '', '', '', '89', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(90, 'Katty de las N.', '', '', '', '', '', '90', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(91, 'Sarahis Pierina', '', '', '', '', '', '91', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(92, 'Tarek', '', '', '', '', '', '92', NULL, 'ganador', 1, 1, '2026-07-21 20:40:41', '2026-07-21 20:51:23'),
(93, 'Alfredo', '', '', '', '', '', '93', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(94, 'Andrew Sebastian', '', '', '', '', '', '94', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(95, 'Vania Lenka', '', '', '', '', '', '95', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(96, 'Ruth Maria', '', '', '', '', '', '96', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(97, 'Rodrigo Martin', '', '', '', '', '', '97', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(98, 'Natalia Teresa', '', '', '', '', '', '98', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(99, 'Catalina Noemi', '', '', '', '', '', '99', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(100, 'Sandra Milena', '', '', '', '', '', '100', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(101, 'Fernanda Constanza', '', '', '', '', '', '101', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(102, 'Priscilla Jessica', '', '', '', '', '', '102', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(103, 'Karen Carolina', '', '', '', '', '', '103', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(104, 'Mitzi Carolina', '', '', '', '', '', '104', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(105, 'Sebastian', '', '', '', '', '', '105', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(106, 'Carlos Andres', '', '', '', '', '', '106', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(107, 'Nancy Susana', '', '', '', '', '', '107', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(108, 'Wladimir John', '', '', '', '', '', '108', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(109, 'Valeska Lissette', '', '', '', '', '', '109', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(110, 'Genny Alejandra', '', '', '', '', '', '110', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(111, 'Camila Fernanda', '', '', '', '', '', '111', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(112, 'Marco Antonio', '', '', '', '', '', '112', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(113, 'Barbara Mayeli', '', '', '', '', '', '113', NULL, 'ganador', 1, 1, '2026-07-21 20:40:41', '2026-07-24 15:07:01'),
(114, 'Eduardo Andres', '', '', '', '', '', '115', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(115, 'Aivory Belen', '', '', '', '', '', '116', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(116, 'Yuri Bladimir', '', '', '', '', '', '117', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(117, 'Macarena Nataly', '', '', '', '', '', '118', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(118, 'Katherine Viviana', '', '', '', '', '', '119', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(119, 'Nicolas Gustavo', '', '', '', '', '', '120', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(120, 'Pamela Andrea', '', '', '', '', '', '121', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(121, 'Paolo Cristobal', '', '', '', '', '', '122', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(122, 'Humberto Arturo', '', '', '', '', '', '123', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(123, 'Rodrigo Alejandro', '', '', '', '', '', '124', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(124, 'Macarena del Pilar', '', '', '', '', '', '125', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(125, 'Matias Ignacio', '', '', '', '', '', '126', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(126, 'Ingrid Paola', '', '', '', '', '', '127', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(127, 'Maria Loreto', '', '', '', '', '', '128', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(128, 'Fernanda Daniela', '', '', '', '', '', '129', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(129, 'Sergio Andres', '', '', '', '', '', '130', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(130, 'Michael Hector', '', '', '', '', '', '131', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(131, 'Felipe Ivan', '', '', '', '', '', '132', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(132, 'Catalina Antonia', '', '', '', '', '', '133', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(133, 'Ninoska Paulina', '', '', '', '', '', '134', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(134, 'Angelica Bernarda', '', '', '', '', '', '135', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(135, 'Jorge Felipe', '', '', '', '', '', '136', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(136, 'Nuria Elizabeth', '', '', '', '', '', '137', NULL, 'disponible', 0, 1, '2026-07-21 20:40:41', '2026-07-21 20:40:41'),
(137, 'Gabriel Lafertte Cárcamo', '', '', '', '', '', '137', NULL, 'disponible', 0, NULL, '2026-07-23 23:12:50', '2026-07-23 23:12:50');

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

--
-- Estructura de tabla para la tabla `sorteos`
--

CREATE TABLE `sorteos` (
  `id` int(11) NOT NULL,
  `nombre_sorteo` varchar(255) NOT NULL,
  `nombre_premio` varchar(255) DEFAULT NULL,
  `descripcion_premio` text DEFAULT NULL,
  `imagen_premio` varchar(255) DEFAULT NULL,
  `cantidad_ganadores` int(11) NOT NULL DEFAULT 1,
  `observaciones` text DEFAULT NULL,
  `estado` enum('waiting','running','stopping','winner','cancelled','finished') NOT NULL DEFAULT 'waiting',
  `programado_para` datetime DEFAULT NULL,
  `started_at` datetime DEFAULT NULL,
  `stopped_at` datetime DEFAULT NULL,
  `finished_at` datetime DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `sorteos` (`id`, `nombre_sorteo`, `nombre_premio`, `descripcion_premio`, `imagen_premio`, `cantidad_ganadores`, `observaciones`, `estado`, `programado_para`, `started_at`, `stopped_at`, `finished_at`, `created_by`, `created_at`, `updated_at`) VALUES
(4, 'Fiesta Anual', NULL, NULL, NULL, 1, NULL, 'running', NULL, NULL, NULL, NULL, 1, '2026-07-24 14:58:01', '2026-07-24 15:06:51');

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

--
-- Estructura de tabla para la tabla `sorteo_ganadores`
--

CREATE TABLE `sorteo_ganadores` (
  `id` int(11) NOT NULL,
  `sorteo_id` int(11) NOT NULL,
  `ronda_id` int(11) DEFAULT NULL,
  `participante_id` int(11) NOT NULL,
  `nombre_premio` varchar(255) DEFAULT NULL,
  `estado` enum('valido','anulado') NOT NULL DEFAULT 'valido',
  `selected_at` datetime DEFAULT NULL,
  `selected_by` int(11) DEFAULT NULL,
  `annulled_at` datetime DEFAULT NULL,
  `annulled_by` int(11) DEFAULT NULL,
  `annulment_reason` varchar(255) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `sorteo_ganadores` (`id`, `sorteo_id`, `ronda_id`, `participante_id`, `nombre_premio`, `estado`, `selected_at`, `selected_by`, `annulled_at`, `annulled_by`, `annulment_reason`, `created_at`, `updated_at`) VALUES
(7, 4, 3, 113, 'Cerlular', 'valido', '2026-07-24 11:07:01', 1, NULL, NULL, NULL, '2026-07-24 15:07:01', '2026-07-24 15:07:01');

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

--
-- Estructura de tabla para la tabla `sorteo_rondas`
--

CREATE TABLE `sorteo_rondas` (
  `id` int(11) NOT NULL,
  `sorteo_id` int(11) NOT NULL,
  `nombre_premio` varchar(255) NOT NULL,
  `estado` enum('running','stopping','winner','cancelled','finished') NOT NULL DEFAULT 'running',
  `started_at` datetime DEFAULT NULL,
  `stopped_at` datetime DEFAULT NULL,
  `cancelled_at` datetime DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `sorteo_rondas` (`id`, `sorteo_id`, `nombre_premio`, `estado`, `started_at`, `stopped_at`, `cancelled_at`, `created_by`, `created_at`, `updated_at`) VALUES
(3, 4, 'Cerlular', 'winner', '2026-07-24 11:06:51', '2026-07-24 11:07:01', NULL, 1, '2026-07-24 15:06:51', '2026-07-24 15:07:01');

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

--
-- Estructura de tabla para la tabla `votacion_configuracion`
--

CREATE TABLE `votacion_configuracion` (
  `id` int(11) NOT NULL,
  `votacion_id` int(11) NOT NULL,
  `clave` varchar(80) NOT NULL,
  `valor` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Estructura de tabla para la tabla `votacion_historial`
--

CREATE TABLE `votacion_historial` (
  `id` int(11) NOT NULL,
  `votacion_id` int(11) DEFAULT NULL,
  `accion` varchar(60) NOT NULL,
  `usuario_admin_id` int(11) DEFAULT NULL,
  `descripcion` varchar(500) DEFAULT NULL,
  `fecha_hora` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `votacion_historial` (`id`, `votacion_id`, `accion`, `usuario_admin_id`, `descripcion`, `fecha_hora`) VALUES
(33, 4, 'CREAR', 1, 'Votación creada: Premio Top Gun', '2026-07-24 14:11:18'),
(34, 4, 'EDITAR', 1, 'Configuración actualizada', '2026-07-24 14:16:09'),
(35, 4, 'ACTIVA', 1, 'Estado → activa', '2026-07-24 14:58:57'),
(36, 4, 'TOGGLE', 1, 'mostrar_qr = 0', '2026-07-24 15:00:23'),
(37, 4, 'TOGGLE', 1, 'mostrar_qr = 1', '2026-07-24 15:00:29'),
(38, 4, 'FINALIZADA', 1, 'Estado → finalizada', '2026-07-24 15:05:52'),
(39, 4, 'TOGGLE', 1, 'mostrar_resultados = 1', '2026-07-24 15:06:06'),
(40, 4, 'GANADORES', 1, 'dir=all revelados=3', '2026-07-24 15:06:12'),
(41, 4, 'REINICIAR', 1, 'Votos archivados; nueva ronda', '2026-07-24 15:09:39'),
(42, 4, 'ACTIVA', 1, 'Estado → activa', '2026-07-24 15:09:40');

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

--
-- Estructura de tabla para la tabla `votacion_participantes`
--

CREATE TABLE `votacion_participantes` (
  `id` int(11) NOT NULL,
  `votacion_id` int(11) NOT NULL,
  `participante_id` int(11) NOT NULL,
  `orden` int(11) NOT NULL DEFAULT 0,
  `activo` tinyint(1) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `votacion_participantes` (`id`, `votacion_id`, `participante_id`, `orden`, `activo`) VALUES
(681, 2, 115, 0, 1),
(682, 2, 31, 1, 1),
(683, 2, 93, 2, 1),
(684, 2, 1, 3, 1),
(685, 2, 42, 4, 1),
(686, 2, 19, 5, 1),
(687, 2, 94, 6, 1),
(688, 2, 134, 7, 1),
(689, 2, 11, 8, 1),
(690, 2, 22, 9, 1),
(691, 2, 55, 10, 1),
(692, 2, 61, 11, 1),
(693, 2, 30, 12, 1),
(694, 2, 32, 13, 1),
(695, 2, 113, 14, 1),
(696, 2, 8, 15, 1),
(697, 2, 41, 16, 1),
(698, 2, 82, 17, 1),
(699, 2, 111, 18, 1),
(700, 2, 66, 19, 1),
(701, 2, 106, 20, 1),
(702, 2, 89, 21, 1),
(703, 2, 132, 22, 1),
(704, 2, 99, 23, 1),
(705, 2, 87, 24, 1),
(706, 2, 13, 25, 1),
(707, 2, 83, 26, 1),
(708, 2, 50, 27, 1),
(709, 2, 12, 28, 1),
(710, 2, 53, 29, 1),
(711, 2, 81, 30, 1),
(712, 2, 73, 31, 1),
(713, 2, 114, 32, 1),
(714, 2, 26, 33, 1),
(715, 2, 88, 34, 1),
(716, 2, 47, 35, 1),
(717, 2, 77, 36, 1),
(718, 2, 131, 37, 1),
(719, 2, 101, 38, 1),
(720, 2, 128, 39, 1),
(721, 2, 14, 40, 1),
(722, 2, 23, 41, 1),
(723, 2, 45, 42, 1),
(724, 2, 67, 43, 1),
(725, 2, 80, 44, 1),
(726, 2, 44, 45, 1),
(727, 2, 110, 46, 1),
(728, 2, 38, 47, 1),
(729, 2, 79, 48, 1),
(730, 2, 69, 49, 1),
(731, 2, 122, 50, 1),
(732, 2, 126, 51, 1),
(733, 2, 33, 52, 1),
(734, 2, 46, 53, 1),
(735, 2, 49, 54, 1),
(736, 2, 70, 55, 1),
(737, 2, 9, 56, 1),
(738, 2, 18, 57, 1),
(739, 2, 135, 58, 1),
(740, 2, 20, 59, 1),
(741, 2, 48, 60, 1),
(742, 2, 56, 61, 1),
(743, 2, 71, 62, 1),
(744, 2, 103, 63, 1),
(745, 2, 43, 64, 1),
(746, 2, 58, 65, 1),
(747, 2, 37, 66, 1),
(748, 2, 118, 67, 1),
(749, 2, 90, 68, 1),
(750, 2, 52, 69, 1),
(751, 2, 60, 70, 1),
(752, 2, 54, 71, 1),
(753, 2, 29, 72, 1),
(754, 2, 25, 73, 1),
(755, 2, 78, 74, 1),
(756, 2, 74, 75, 1),
(757, 2, 124, 76, 1),
(758, 2, 3, 77, 1),
(759, 2, 117, 78, 1),
(760, 2, 86, 79, 1),
(761, 2, 72, 80, 1),
(762, 2, 112, 81, 1),
(763, 2, 4, 82, 1),
(764, 2, 35, 83, 1),
(765, 2, 15, 84, 1),
(766, 2, 84, 85, 1),
(767, 2, 127, 86, 1),
(768, 2, 39, 87, 1),
(769, 2, 62, 88, 1),
(770, 2, 10, 89, 1),
(771, 2, 85, 90, 1),
(772, 2, 125, 91, 1),
(773, 2, 130, 92, 1),
(774, 2, 65, 93, 1),
(775, 2, 2, 94, 1),
(776, 2, 104, 95, 1),
(777, 2, 107, 96, 1),
(778, 2, 51, 97, 1),
(779, 2, 68, 98, 1),
(780, 2, 98, 99, 1),
(781, 2, 119, 100, 1),
(782, 2, 59, 101, 1),
(783, 2, 133, 102, 1),
(784, 2, 34, 103, 1),
(785, 2, 136, 104, 1),
(786, 2, 63, 105, 1),
(787, 2, 28, 106, 1),
(788, 2, 64, 107, 1),
(789, 2, 120, 108, 1),
(790, 2, 121, 109, 1),
(791, 2, 36, 110, 1),
(792, 2, 102, 111, 1),
(793, 2, 24, 112, 1),
(794, 2, 123, 113, 1),
(795, 2, 75, 114, 1),
(796, 2, 97, 115, 1),
(797, 2, 21, 116, 1),
(798, 2, 16, 117, 1),
(799, 2, 27, 118, 1),
(800, 2, 96, 119, 1),
(801, 2, 100, 120, 1),
(802, 2, 91, 121, 1),
(803, 2, 105, 122, 1),
(804, 2, 129, 123, 1),
(805, 2, 92, 124, 1),
(806, 2, 40, 125, 1),
(807, 2, 17, 126, 1),
(808, 2, 109, 127, 1),
(809, 2, 95, 128, 1),
(810, 2, 6, 129, 1),
(811, 2, 5, 130, 1),
(812, 2, 108, 131, 1),
(813, 2, 76, 132, 1),
(814, 2, 7, 133, 1),
(815, 2, 57, 134, 1),
(816, 2, 116, 135, 1),
(817, 3, 115, 0, 1),
(818, 3, 31, 1, 1),
(819, 3, 93, 2, 1),
(820, 3, 1, 3, 1),
(821, 3, 42, 4, 1),
(822, 3, 19, 5, 1),
(823, 3, 94, 6, 1),
(824, 3, 134, 7, 1),
(825, 3, 11, 8, 1),
(826, 3, 22, 9, 1),
(827, 3, 55, 10, 1),
(828, 3, 61, 11, 1),
(829, 3, 30, 12, 1),
(830, 3, 32, 13, 1),
(831, 3, 113, 14, 1),
(832, 3, 8, 15, 1),
(833, 3, 41, 16, 1),
(834, 3, 82, 17, 1),
(835, 3, 111, 18, 1),
(836, 3, 66, 19, 1),
(837, 3, 106, 20, 1),
(838, 3, 89, 21, 1),
(839, 3, 132, 22, 1),
(840, 3, 99, 23, 1),
(841, 3, 87, 24, 1),
(842, 3, 13, 25, 1),
(843, 3, 83, 26, 1),
(844, 3, 50, 27, 1),
(845, 3, 12, 28, 1),
(846, 3, 53, 29, 1),
(847, 3, 81, 30, 1),
(848, 3, 73, 31, 1),
(849, 3, 114, 32, 1),
(850, 3, 26, 33, 1),
(851, 3, 88, 34, 1),
(852, 3, 47, 35, 1),
(853, 3, 77, 36, 1),
(854, 3, 131, 37, 1),
(855, 3, 101, 38, 1),
(856, 3, 128, 39, 1),
(857, 3, 14, 40, 1),
(858, 3, 23, 41, 1),
(859, 3, 45, 42, 1),
(860, 3, 67, 43, 1),
(861, 3, 80, 44, 1),
(862, 3, 44, 45, 1),
(863, 3, 110, 46, 1),
(864, 3, 38, 47, 1),
(865, 3, 79, 48, 1),
(866, 3, 69, 49, 1),
(867, 3, 122, 50, 1),
(868, 3, 126, 51, 1),
(869, 3, 33, 52, 1),
(870, 3, 46, 53, 1),
(871, 3, 49, 54, 1),
(872, 3, 70, 55, 1),
(873, 3, 9, 56, 1),
(874, 3, 18, 57, 1),
(875, 3, 135, 58, 1),
(876, 3, 20, 59, 1),
(877, 3, 48, 60, 1),
(878, 3, 56, 61, 1),
(879, 3, 71, 62, 1),
(880, 3, 103, 63, 1),
(881, 3, 43, 64, 1),
(882, 3, 58, 65, 1),
(883, 3, 37, 66, 1),
(884, 3, 118, 67, 1),
(885, 3, 90, 68, 1),
(886, 3, 52, 69, 1),
(887, 3, 60, 70, 1),
(888, 3, 54, 71, 1),
(889, 3, 29, 72, 1),
(890, 3, 25, 73, 1),
(891, 3, 78, 74, 1),
(892, 3, 74, 75, 1),
(893, 3, 124, 76, 1),
(894, 3, 3, 77, 1),
(895, 3, 117, 78, 1),
(896, 3, 86, 79, 1),
(897, 3, 72, 80, 1),
(898, 3, 112, 81, 1),
(899, 3, 4, 82, 1),
(900, 3, 35, 83, 1),
(901, 3, 15, 84, 1),
(902, 3, 84, 85, 1),
(903, 3, 127, 86, 1),
(904, 3, 39, 87, 1),
(905, 3, 62, 88, 1),
(906, 3, 10, 89, 1),
(907, 3, 85, 90, 1),
(908, 3, 125, 91, 1),
(909, 3, 130, 92, 1),
(910, 3, 65, 93, 1),
(911, 3, 2, 94, 1),
(912, 3, 104, 95, 1),
(913, 3, 107, 96, 1),
(914, 3, 51, 97, 1),
(915, 3, 68, 98, 1),
(916, 3, 98, 99, 1),
(917, 3, 119, 100, 1),
(918, 3, 59, 101, 1),
(919, 3, 133, 102, 1),
(920, 3, 34, 103, 1),
(921, 3, 136, 104, 1),
(922, 3, 63, 105, 1),
(923, 3, 28, 106, 1),
(924, 3, 64, 107, 1),
(925, 3, 120, 108, 1),
(926, 3, 121, 109, 1),
(927, 3, 36, 110, 1),
(928, 3, 102, 111, 1),
(929, 3, 24, 112, 1),
(930, 3, 123, 113, 1),
(931, 3, 75, 114, 1),
(932, 3, 97, 115, 1),
(933, 3, 21, 116, 1),
(934, 3, 16, 117, 1),
(935, 3, 27, 118, 1),
(936, 3, 96, 119, 1),
(937, 3, 100, 120, 1),
(938, 3, 91, 121, 1),
(939, 3, 105, 122, 1),
(940, 3, 129, 123, 1),
(941, 3, 92, 124, 1),
(942, 3, 40, 125, 1),
(943, 3, 17, 126, 1),
(944, 3, 109, 127, 1),
(945, 3, 95, 128, 1),
(946, 3, 6, 129, 1),
(947, 3, 5, 130, 1),
(948, 3, 108, 131, 1),
(949, 3, 76, 132, 1),
(950, 3, 7, 133, 1),
(951, 3, 57, 134, 1),
(952, 3, 116, 135, 1),
(953, 4, 115, 0, 1),
(954, 4, 31, 1, 1),
(955, 4, 93, 2, 1),
(956, 4, 1, 3, 1),
(957, 4, 42, 4, 1),
(958, 4, 19, 5, 1),
(959, 4, 94, 6, 1),
(960, 4, 134, 7, 1),
(961, 4, 11, 8, 1),
(962, 4, 22, 9, 1),
(963, 4, 55, 10, 1),
(964, 4, 61, 11, 1),
(965, 4, 30, 12, 1),
(966, 4, 32, 13, 1),
(967, 4, 113, 14, 1),
(968, 4, 8, 15, 1),
(969, 4, 41, 16, 1),
(970, 4, 82, 17, 1),
(971, 4, 111, 18, 1),
(972, 4, 66, 19, 1),
(973, 4, 106, 20, 1),
(974, 4, 89, 21, 1),
(975, 4, 132, 22, 1),
(976, 4, 99, 23, 1),
(977, 4, 87, 24, 1),
(978, 4, 13, 25, 1),
(979, 4, 83, 26, 1),
(980, 4, 50, 27, 1),
(981, 4, 12, 28, 1),
(982, 4, 53, 29, 1),
(983, 4, 81, 30, 1),
(984, 4, 73, 31, 1),
(985, 4, 114, 32, 1),
(986, 4, 26, 33, 1),
(987, 4, 88, 34, 1),
(988, 4, 47, 35, 1),
(989, 4, 77, 36, 1),
(990, 4, 131, 37, 1),
(991, 4, 101, 38, 1),
(992, 4, 128, 39, 1),
(993, 4, 14, 40, 1),
(994, 4, 23, 41, 1),
(995, 4, 45, 42, 1),
(996, 4, 67, 43, 1),
(997, 4, 80, 44, 1),
(998, 4, 44, 45, 1),
(999, 4, 137, 46, 1),
(1000, 4, 110, 47, 1),
(1001, 4, 38, 48, 1),
(1002, 4, 79, 49, 1),
(1003, 4, 69, 50, 1),
(1004, 4, 122, 51, 1),
(1005, 4, 126, 52, 1),
(1006, 4, 33, 53, 1),
(1007, 4, 46, 54, 1),
(1008, 4, 49, 55, 1),
(1009, 4, 70, 56, 1),
(1010, 4, 9, 57, 1),
(1011, 4, 18, 58, 1),
(1012, 4, 135, 59, 1),
(1013, 4, 20, 60, 1),
(1014, 4, 48, 61, 1),
(1015, 4, 56, 62, 1),
(1016, 4, 71, 63, 1),
(1017, 4, 103, 64, 1),
(1018, 4, 43, 65, 1),
(1019, 4, 58, 66, 1),
(1020, 4, 37, 67, 1),
(1021, 4, 118, 68, 1),
(1022, 4, 90, 69, 1),
(1023, 4, 52, 70, 1),
(1024, 4, 60, 71, 1),
(1025, 4, 54, 72, 1),
(1026, 4, 29, 73, 1),
(1027, 4, 25, 74, 1),
(1028, 4, 78, 75, 1),
(1029, 4, 74, 76, 1),
(1030, 4, 124, 77, 1),
(1031, 4, 3, 78, 1),
(1032, 4, 117, 79, 1),
(1033, 4, 86, 80, 1),
(1034, 4, 72, 81, 1),
(1035, 4, 112, 82, 1),
(1036, 4, 4, 83, 1),
(1037, 4, 35, 84, 1),
(1038, 4, 15, 85, 1),
(1039, 4, 84, 86, 1),
(1040, 4, 127, 87, 1),
(1041, 4, 39, 88, 1),
(1042, 4, 62, 89, 1),
(1043, 4, 10, 90, 1),
(1044, 4, 85, 91, 1),
(1045, 4, 125, 92, 1),
(1046, 4, 130, 93, 1),
(1047, 4, 65, 94, 1),
(1048, 4, 2, 95, 1),
(1049, 4, 104, 96, 1),
(1050, 4, 107, 97, 1),
(1051, 4, 51, 98, 1),
(1052, 4, 68, 99, 1),
(1053, 4, 98, 100, 1),
(1054, 4, 119, 101, 1),
(1055, 4, 59, 102, 1),
(1056, 4, 133, 103, 1),
(1057, 4, 34, 104, 1),
(1058, 4, 136, 105, 1),
(1059, 4, 63, 106, 1),
(1060, 4, 28, 107, 1),
(1061, 4, 64, 108, 1),
(1062, 4, 120, 109, 1),
(1063, 4, 121, 110, 1),
(1064, 4, 36, 111, 1),
(1065, 4, 102, 112, 1),
(1066, 4, 24, 113, 1),
(1067, 4, 123, 114, 1),
(1068, 4, 75, 115, 1),
(1069, 4, 97, 116, 1),
(1070, 4, 21, 117, 1),
(1071, 4, 16, 118, 1),
(1072, 4, 27, 119, 1),
(1073, 4, 96, 120, 1),
(1074, 4, 100, 121, 1),
(1075, 4, 91, 122, 1),
(1076, 4, 105, 123, 1),
(1077, 4, 129, 124, 1),
(1078, 4, 92, 125, 1),
(1079, 4, 40, 126, 1),
(1080, 4, 17, 127, 1),
(1081, 4, 109, 128, 1),
(1082, 4, 95, 129, 1),
(1083, 4, 6, 130, 1),
(1084, 4, 5, 131, 1),
(1085, 4, 108, 132, 1),
(1086, 4, 76, 133, 1),
(1087, 4, 7, 134, 1),
(1088, 4, 57, 135, 1),
(1089, 4, 116, 136, 1);

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

--
-- Estructura de tabla para la tabla `_bak_encuestas`
--

CREATE TABLE `_bak_encuestas` (
  `id` int(11) NOT NULL DEFAULT 0,
  `titulo` varchar(255) NOT NULL,
  `descripcion` text DEFAULT NULL,
  `activa` tinyint(1) DEFAULT 1,
  `fecha_creacion` timestamp NOT NULL DEFAULT current_timestamp(),
  `fecha_cierre` timestamp NULL DEFAULT NULL,
  `total_votos` int(11) DEFAULT 0,
  `admin_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Estructura de tabla para la tabla `_bak_opciones`
--

CREATE TABLE `_bak_opciones` (
  `id` int(11) NOT NULL DEFAULT 0,
  `encuesta_id` int(11) NOT NULL,
  `texto_opcion` varchar(255) NOT NULL,
  `votos` int(11) DEFAULT 0,
  `orden` int(11) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Estructura de tabla para la tabla `_bak_sorteos`
--

CREATE TABLE `_bak_sorteos` (
  `id` int(11) NOT NULL DEFAULT 0,
  `encuesta_id` int(11) DEFAULT NULL,
  `usuario_ganador_id` int(11) NOT NULL,
  `fecha_sorteo` timestamp NOT NULL DEFAULT current_timestamp(),
  `admin_id` int(11) DEFAULT NULL,
  `descripcion` varchar(255) DEFAULT NULL,
  `nombre_premio` varchar(255) NOT NULL DEFAULT '',
  `tipo_sorteo` enum('general','encuesta') DEFAULT 'general'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

INSERT INTO `_bak_sorteos` (`id`, `encuesta_id`, `usuario_ganador_id`, `fecha_sorteo`, `admin_id`, `descripcion`, `nombre_premio`, `tipo_sorteo`) VALUES
(21, NULL, 264, '2026-07-21 20:00:40', 1, 'Sorteo de iPhone 15', 'iPhone 15', 'general');

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

--
-- Estructura de tabla para la tabla `_bak_usuarios_sorteo`
--

CREATE TABLE `_bak_usuarios_sorteo` (
  `id` int(11) NOT NULL DEFAULT 0,
  `nombre` varchar(255) NOT NULL,
  `email` varchar(255) DEFAULT NULL,
  `telefono` varchar(20) DEFAULT NULL,
  `documento` varchar(50) DEFAULT NULL,
  `activo` tinyint(1) DEFAULT 1,
  `fecha_carga` timestamp NOT NULL DEFAULT current_timestamp(),
  `encuesta_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

INSERT INTO `_bak_usuarios_sorteo` (`id`, `nombre`, `email`, `telefono`, `documento`, `activo`, `fecha_carga`, `encuesta_id`) VALUES
(159, '1', 'Aguirre', 'Quijada', 'Alicia Cristina', 1, '2026-07-21 20:00:27', NULL),
(160, '2', 'Alcaino', 'Valenzuela', 'Miguel Ignacio', 1, '2026-07-21 20:00:27', NULL),
(161, '3', 'Álvarez', 'Sepúlveda', 'Macarena Fernanda', 1, '2026-07-21 20:00:27', NULL),
(162, '4', 'Arango', 'Delgado', 'María del Pilar', 1, '2026-07-21 20:00:27', NULL),
(163, '5', 'Arenas', 'Díaz', 'Víctor Gabriel', 1, '2026-07-21 20:00:27', NULL),
(164, '6', 'Barahona', 'Kaschel', 'Verónica Andrea', 1, '2026-07-21 20:00:27', NULL),
(165, '7', 'Barria', 'Sáez', 'Yanira del Carmen', 1, '2026-07-21 20:00:27', NULL),
(166, '8', 'Barrientos', 'Fuentes', 'Bayron Alejandro', 1, '2026-07-21 20:00:27', NULL),
(167, '9', 'Barrios', 'Basanta', 'Johannymar Nazareth', 1, '2026-07-21 20:00:27', NULL),
(168, '10', 'Becerra', 'Verdugo', 'Marisol Pilar', 1, '2026-07-21 20:00:27', NULL),
(169, '11', 'Benavides', 'Silva', 'Antonio Francisco', 1, '2026-07-21 20:00:27', NULL),
(170, '12', 'Blanco', 'De La Parra', 'Daniel Ignacio', 1, '2026-07-21 20:00:27', NULL),
(171, '13', 'Bossi', 'Martínez', 'Claudia Erna', 1, '2026-07-21 20:00:27', NULL),
(172, '14', 'Bravo', 'Huenchulaf', 'Francesco Alexander', 1, '2026-07-21 20:00:27', NULL),
(173, '15', 'Bruce', 'Montes', 'María José', 1, '2026-07-21 20:00:27', NULL),
(174, '16', 'Bustos', 'Rioseco', 'Romina Salome', 1, '2026-07-21 20:00:27', NULL),
(175, '17', 'Cáceres', 'Salas', 'Valerie Andrea', 1, '2026-07-21 20:00:27', NULL),
(176, '19', 'Campillay', 'Martínez', 'Ana Isabel', 1, '2026-07-21 20:00:27', NULL),
(177, '20', 'Carrasco', 'Muñoz', 'Josefa Andrea', 1, '2026-07-21 20:00:27', NULL),
(178, '21', 'Castro', 'Vega', 'Romina Andrea', 1, '2026-07-21 20:00:27', NULL),
(179, '23', 'Cepeda', 'Bleck', 'Franchesca Andrea', 1, '2026-07-21 20:00:27', NULL),
(180, '24', 'Collipal', 'Aedo', 'Rocío Estrella', 1, '2026-07-21 20:00:27', NULL),
(181, '25', 'Contreras', 'Pittaluga', 'Lorena Ángelica', 1, '2026-07-21 20:00:27', NULL),
(182, '26', 'Cornejo', 'Rodríguez', 'Elizabeth Viviana', 1, '2026-07-21 20:00:27', NULL),
(183, '27', 'Cristi', 'Tejeda', 'Rosario Andrea', 1, '2026-07-21 20:00:27', NULL),
(184, '28', 'Cubelli', 'Nazer', 'Ornella Karime', 1, '2026-07-21 20:00:27', NULL),
(185, '29', 'Díaz', 'Leyton', 'Lissette', 1, '2026-07-21 20:00:27', NULL),
(186, '31', 'Duque', 'Aponte', 'Alejandra Carolina', 1, '2026-07-21 20:00:27', NULL),
(187, '32', 'Duran', 'Portales', 'Barbara Isidora', 1, '2026-07-21 20:00:27', NULL),
(188, '33', 'Elgueta', 'Orellana', 'Ivette Erna', 1, '2026-07-21 20:00:27', NULL),
(189, '34', 'Erazo', 'Pérez', 'Noelia Naomi', 1, '2026-07-21 20:00:27', NULL),
(190, '35', 'Facciolo', '', 'María Eugenia', 1, '2026-07-21 20:00:27', NULL),
(191, '36', 'Farías', 'Flores', 'Patricia Ángelica', 1, '2026-07-21 20:00:27', NULL),
(192, '37', 'Fernández', 'Rioseco', 'Karla Patricia', 1, '2026-07-21 20:00:27', NULL),
(193, '39', 'Figueroa', 'Orellana', 'Marianela Catalina', 1, '2026-07-21 20:00:27', NULL),
(194, '40', 'Flores', 'Olea', 'Valeria Katerina', 1, '2026-07-21 20:00:27', NULL),
(195, '41', 'Friz', 'Ramírez', 'Camila Constanza', 1, '2026-07-21 20:00:27', NULL),
(196, '42', 'Fuentes', 'Bastidas', 'Amalia Yaneska', 1, '2026-07-21 20:00:27', NULL),
(197, '43', 'Gaete', 'Garrido', 'Karin Valeria', 1, '2026-07-21 20:00:27', NULL),
(198, '44', 'Garay', 'González', 'Francisco Andres', 1, '2026-07-21 20:00:27', NULL),
(199, '45', 'García', 'De La Huerta', 'Francisca Arrau', 1, '2026-07-21 20:00:27', NULL),
(200, '47', 'González', 'Muñoz', 'Fabiola Alejandra', 1, '2026-07-21 20:00:27', NULL),
(201, '48', 'Guevara', 'Gutiérrez', 'Joyce Vanessa', 1, '2026-07-21 20:00:27', NULL),
(202, '49', 'Guzmán', 'Osorio', 'Javiera Francisca', 1, '2026-07-21 20:00:27', NULL),
(203, '50', 'Henríquez', 'Mora', 'Claudio Andres', 1, '2026-07-21 20:00:27', NULL),
(204, '51', 'Hermosilla', 'Bravo', 'Nancy Ximena', 1, '2026-07-21 20:00:27', NULL),
(205, '52', 'Hernández', 'Salas', 'Kevin Ignacio', 1, '2026-07-21 20:00:27', NULL),
(206, '53', 'Herrera', 'Campos', 'Daniela Alejandra', 1, '2026-07-21 20:00:27', NULL),
(207, '54', 'Ibañez', 'González', 'Leonardo Sebastían', 1, '2026-07-21 20:00:27', NULL),
(208, '55', 'Ibarra', 'Muñoz', 'Barbara', 1, '2026-07-21 20:00:27', NULL),
(209, '56', 'Irarrazabal', 'Chamorro', 'Juan Cristian', 1, '2026-07-21 20:00:27', NULL),
(210, '57', 'Iturrieta', 'González', 'Yessenia Andrea', 1, '2026-07-21 20:00:27', NULL),
(211, '58', 'Jaime', 'Barrientos', 'Karina Alejandra', 1, '2026-07-21 20:00:27', NULL),
(212, '59', 'Jara', 'Ureta', 'Nicole Marisol', 1, '2026-07-21 20:00:27', NULL),
(213, '61', 'Lizama', 'Ormeño', 'Barbara Elizabeth', 1, '2026-07-21 20:00:27', NULL),
(214, '62', 'López', 'Ponce', 'Marietta Angelina', 1, '2026-07-21 20:00:27', NULL),
(215, '63', 'Loukachevitch', '', 'Olga', 1, '2026-07-21 20:00:27', NULL),
(216, '64', 'Maldonado', 'Vásquez', 'Pablo Andres', 1, '2026-07-21 20:00:27', NULL),
(217, '65', 'Malio', 'Rojas', 'Miguel Andres', 1, '2026-07-21 20:00:27', NULL),
(218, '66', 'Malschafsky', 'Corvalán', 'Camila Nicole', 1, '2026-07-21 20:00:27', NULL),
(219, '67', 'Mancilla', 'Cárcamo', 'Francisca Belen', 1, '2026-07-21 20:00:27', NULL),
(220, '68', 'Manquehual', 'Pincheira', 'Natalia Isabel', 1, '2026-07-21 20:00:27', NULL),
(221, '69', 'Marnich', 'Navarrete', 'Hans Mirko', 1, '2026-07-21 20:00:27', NULL),
(222, '70', 'Márquez', 'Lavanderos', 'Jocelyn Alejandra', 1, '2026-07-21 20:00:27', NULL),
(223, '71', 'Mendoza', 'Veas', 'Julio Hernan', 1, '2026-07-21 20:00:27', NULL),
(224, '72', 'Merino', 'Venegas', 'Marcela Andrea', 1, '2026-07-21 20:00:27', NULL),
(225, '73', 'Mieres', 'Cayul', 'David Alfredo', 1, '2026-07-21 20:00:27', NULL),
(226, '74', 'Montero', 'Cerda', 'Luis Marcelo', 1, '2026-07-21 20:00:27', NULL),
(227, '75', 'Morales', 'Torres', 'Rodrigo Andres', 1, '2026-07-21 20:00:27', NULL),
(228, '78', 'Moreno', 'Moreno', 'Luciana Jimena', 1, '2026-07-21 20:00:27', NULL),
(229, '79', 'Muñoz', 'Muñoz', 'Gricel Andrea', 1, '2026-07-21 20:00:27', NULL),
(230, '81', 'Navarro', 'Gutiérrez', 'Daniela Susana', 1, '2026-07-21 20:00:27', NULL),
(231, '82', 'Novoa', 'Cea', 'Camila Estrella', 1, '2026-07-21 20:00:27', NULL),
(232, '83', 'Nuñez', 'Valencia', 'Claudia Ximena', 1, '2026-07-21 20:00:27', NULL),
(233, '84', 'Olivares', '', 'María Julieta', 1, '2026-07-21 20:00:27', NULL),
(234, '85', 'Opazo', 'Medina', 'Matias Andres', 1, '2026-07-21 20:00:27', NULL),
(235, '86', 'Ortiz', 'Clift', 'Makarena Constanza', 1, '2026-07-21 20:00:27', NULL),
(236, '87', 'Osorio', 'Lisboa', 'Cecilia Angelina', 1, '2026-07-21 20:00:27', NULL),
(237, '88', 'Pacheco', 'Moller', 'Erika Edith', 1, '2026-07-21 20:00:27', NULL),
(238, '89', 'Peña', 'Cartes', 'Carolina Alejandra', 1, '2026-07-21 20:00:27', NULL),
(239, '90', 'Pérez', 'Salinas', 'Katty de las N.', 1, '2026-07-21 20:00:27', NULL),
(240, '92', 'Pichara', 'Saud', 'Tarek', 1, '2026-07-21 20:00:27', NULL),
(241, '93', 'Pinilla', 'Araya', 'Alfredo', 1, '2026-07-21 20:00:27', NULL),
(242, '94', 'Pino', 'Muñoz', 'Andrew Sebastian', 1, '2026-07-21 20:00:27', NULL),
(243, '95', 'Pizarro', 'Morales', 'Vania Lenka', 1, '2026-07-21 20:00:27', NULL),
(244, '96', 'Poblete', 'Carrillanca', 'Ruth Maria', 1, '2026-07-21 20:00:27', NULL),
(245, '97', 'Pradel', 'Villalobos', 'Rodrigo Martin', 1, '2026-07-21 20:00:27', NULL),
(246, '98', 'Reyes', 'Rodríguez', 'Natalia Teresa', 1, '2026-07-21 20:00:27', NULL),
(247, '100', 'Rincon', 'Pinilla', 'Sandra Milena', 1, '2026-07-21 20:00:27', NULL),
(248, '101', 'Ríos', 'Montenegro', 'Fernanda Constanza', 1, '2026-07-21 20:00:27', NULL),
(249, '102', 'Robles', 'Astudillo', 'Priscilla Jessica', 1, '2026-07-21 20:00:27', NULL),
(250, '103', 'Rojas', 'Burgos', 'Karen Carolina', 1, '2026-07-21 20:00:27', NULL),
(251, '104', 'Román', 'Sepúlveda', 'Mitzi Carolina', 1, '2026-07-21 20:00:27', NULL),
(252, '105', 'Rubina', 'Espinoza', 'Sebastian', 1, '2026-07-21 20:00:27', NULL),
(253, '106', 'Rubio', 'Vera', 'Carlos Andres', 1, '2026-07-21 20:00:27', NULL),
(254, '107', 'Ruíz', 'Rodríguez', 'Nancy Susana', 1, '2026-07-21 20:00:27', NULL),
(255, '108', 'Sánchez', 'Zamorano', 'Wladimir John', 1, '2026-07-21 20:00:27', NULL),
(256, '114', 'Sanhueza', 'Hernández', 'Camila Fernanda', 1, '2026-07-21 20:00:27', NULL),
(257, '115', 'Schramm', 'Quintuman', 'Eduardo Andres', 1, '2026-07-21 20:00:27', NULL),
(258, '116', 'Sepúlveda', 'Garay', 'Aivory Belen', 1, '2026-07-21 20:00:27', NULL),
(259, '117', 'Silva', 'Salinas', 'Yuri Bladimir', 1, '2026-07-21 20:00:27', NULL),
(260, '118', 'Soto', 'Melo', 'Macarena Nataly', 1, '2026-07-21 20:00:27', NULL),
(261, '120', 'Turrys', 'Morales', 'Nicolas Gustavo', 1, '2026-07-21 20:00:27', NULL),
(262, '121', 'Ulloa', 'Riveros', 'Pamela Andrea', 1, '2026-07-21 20:00:27', NULL),
(263, '122', 'Uribe', 'Asin', 'Paolo Cristobal', 1, '2026-07-21 20:00:27', NULL),
(264, '123', 'Urzúa', 'Miranda', 'Humberto Arturo', 1, '2026-07-21 20:00:27', NULL),
(265, '124', 'Valderrama', 'Parraguez', 'Rodrigo Alejandro', 1, '2026-07-21 20:00:27', NULL),
(266, '125', 'Valdés', 'González', 'Macarena del Pilar', 1, '2026-07-21 20:00:27', NULL),
(267, '126', 'Valenzuela', 'Rodríguez', 'Matias Ignacio', 1, '2026-07-21 20:00:27', NULL),
(268, '127', 'Vargas', 'Benavente', 'Ingrid Paola', 1, '2026-07-21 20:00:27', NULL),
(269, '128', 'Vásquez', 'Letelier', 'Maria Loreto', 1, '2026-07-21 20:00:27', NULL),
(270, '129', 'Venegas', 'Acevedo', 'Fernanda Daniela', 1, '2026-07-21 20:00:27', NULL),
(271, '131', 'Vicencio', 'Pérez', 'Michael Hector', 1, '2026-07-21 20:00:27', NULL),
(272, '132', 'Vidal', 'Rojas', 'Felipe Ivan', 1, '2026-07-21 20:00:27', NULL),
(273, '133', 'Vilches', 'Medina', 'Catalina Antonia', 1, '2026-07-21 20:00:27', NULL),
(274, '134', 'Vivanco', 'Vega', 'Ninoska Paulina', 1, '2026-07-21 20:00:27', NULL),
(275, '135', 'Yañez', 'Aguilar', 'Angelica Bernarda', 1, '2026-07-21 20:00:27', NULL),
(276, '136', 'Yevenes', 'Bienzobas', 'Jorge Felipe', 1, '2026-07-21 20:00:27', NULL),
(277, '137', 'Zagal', 'Leibur', 'Nuria Elizabeth', 1, '2026-07-21 20:00:27', NULL);

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

--
-- Estructura de tabla para la tabla `_bak_votos`
--

CREATE TABLE `_bak_votos` (
  `id` int(11) NOT NULL DEFAULT 0,
  `encuesta_id` int(11) NOT NULL,
  `opcion_id` int(11) NOT NULL,
  `ip_usuario` varchar(45) NOT NULL,
  `user_agent` text DEFAULT NULL,
  `fecha_voto` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Indices de la tabla `configuracion`
--
ALTER TABLE `configuracion`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uk_clave` (`clave`);

--
-- Indices de la tabla `galeria_fotos`
--
ALTER TABLE `galeria_fotos`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_activo_orden` (`activo`,`orden`);

--
-- Indices de la tabla `import_batches`
--
ALTER TABLE `import_batches`
  ADD PRIMARY KEY (`id`);

--
-- Indices de la tabla `logs_actividad`
--
ALTER TABLE `logs_actividad`
  ADD PRIMARY KEY (`id`),
  ADD KEY `admin_id` (`admin_id`),
  ADD KEY `idx_logs_fecha` (`fecha`);

--
-- Indices de la tabla `participantes`
--
ALTER TABLE `participantes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_estado` (`estado`),
  ADD KEY `idx_identificador` (`identificador`),
  ADD KEY `idx_batch` (`import_batch_id`);

--
-- Indices de la tabla `sorteos`
--
ALTER TABLE `sorteos`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_estado` (`estado`),
  ADD KEY `idx_created_by` (`created_by`);

--
-- Indices de la tabla `sorteo_ganadores`
--
ALTER TABLE `sorteo_ganadores`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_sorteo` (`sorteo_id`),
  ADD KEY `idx_participante` (`participante_id`),
  ADD KEY `idx_estado` (`estado`),
  ADD KEY `idx_ronda` (`ronda_id`);

--
-- Indices de la tabla `sorteo_rondas`
--
ALTER TABLE `sorteo_rondas`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_sorteo` (`sorteo_id`),
  ADD KEY `idx_estado` (`estado`);

--
-- Indices de la tabla `votacion_configuracion`
--
ALTER TABLE `votacion_configuracion`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uk_vot_clave` (`votacion_id`,`clave`);

--
-- Indices de la tabla `votacion_historial`
--
ALTER TABLE `votacion_historial`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_votacion` (`votacion_id`);

--
-- Indices de la tabla `votacion_participantes`
--
ALTER TABLE `votacion_participantes`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uk_vot_part` (`votacion_id`,`participante_id`),
  ADD KEY `idx_votacion` (`votacion_id`);

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

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

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

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

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

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

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

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

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

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

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

--
-- Restricciones para tablas volcadas
--

--
-- Filtros para la tabla `logs_actividad`
--
ALTER TABLE `logs_actividad`
  ADD CONSTRAINT `logs_actividad_ibfk_1` FOREIGN KEY (`admin_id`) REFERENCES `administradores` (`id`) ON DELETE SET NULL;
COMMIT;

