-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 11-04-2026 a las 02:50:48
-- Versión del servidor: 10.4.32-MariaDB
-- Versión de PHP: 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 */;

--
-- Base de datos: `ficha_db`
--

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

--
-- Estructura de tabla para la tabla `academic_records`
--

CREATE TABLE `academic_records` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `first_names` varchar(255) NOT NULL,
  `last_names` varchar(255) NOT NULL,
  `dni` varchar(255) NOT NULL,
  `cohort` varchar(255) NOT NULL,
  `specialty` varchar(255) NOT NULL,
  `birth_date` date NOT NULL,
  `registration_date` date NOT NULL,
  `book` varchar(255) NOT NULL,
  `folio` varchar(255) NOT NULL,
  `location` varchar(255) NOT NULL,
  `custom_values` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`custom_values`)),
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `academic_records` (`id`, `first_names`, `last_names`, `dni`, `cohort`, `specialty`, `birth_date`, `registration_date`, `book`, `folio`, `location`, `custom_values`, `created_at`, `updated_at`) VALUES
(1, 'JUAN PABLO', 'PEREZ RODRIGUEZ', '12345678', '2024-I', 'INGENIERÍA DE SISTEMAS', '1995-05-15', '2024-12-10', 'L-001', 'F-45', 'ARCHIVERO CENTRAL PASILLO B', '{\"Direccion\":\"Av san martin\",\"Telefono\":\"04123996988\"}', '2026-04-10 08:53:29', '2026-04-10 18:57:43'),
(2, 'JOSE DAVID', 'HIDALGO OLIVERO', '17148064', '2014-II', 'Informatica', '1986-01-27', '2014-06-20', 'L-002', 'F-46', 'Secretaria piso 1 estante 23', '{\"Direccion\":\"San Martin Parque Residencial san juan\",\"Telefono\":\"04123996988\"}', '2026-04-10 20:42:50', '2026-04-10 20:43:11');

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

--
-- Estructura de tabla para la tabla `custom_fields`
--

CREATE TABLE `custom_fields` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `label` varchar(255) NOT NULL,
  `section` enum('personal','academic','additional') NOT NULL DEFAULT 'additional',
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `custom_fields` (`id`, `label`, `section`, `is_active`, `created_at`, `updated_at`) VALUES
(1, 'Telefono', 'additional', 1, '2026-04-10 18:29:25', '2026-04-10 18:29:25'),
(2, 'Direccion', 'personal', 1, '2026-04-10 18:56:31', '2026-04-10 18:56:31');

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

--
-- Estructura de tabla para la tabla `migrations`
--

CREATE TABLE `migrations` (
  `id` int(10) UNSIGNED NOT NULL,
  `migration` varchar(255) NOT NULL,
  `batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2024_01_01_000001_create_users_table', 1),
(2, '2024_01_01_000002_create_academic_records_table', 1),
(3, '2024_01_01_000003_create_custom_fields_table', 2),
(4, '2024_01_01_000004_add_custom_values_to_academic_records', 2),
(5, '2024_01_01_000005_add_section_to_custom_fields', 3);

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

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

CREATE TABLE `users` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  `role` enum('admin','user') NOT NULL DEFAULT 'user',
  `remember_token` varchar(100) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `users` (`id`, `name`, `email`, `password`, `role`, `remember_token`, `created_at`, `updated_at`) VALUES
(1, 'Administrador', 'admin@ficha.com', '$2y$12$KyIlBqVUL6HuiFkm77nDiepFXMkEgVEiOf/k.inFPU4nHqXi3K23i', 'admin', NULL, '2026-04-10 08:53:29', '2026-04-10 08:53:29');

--
-- Índices para tablas volcadas
--

--
-- Indices de la tabla `academic_records`
--
ALTER TABLE `academic_records`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `academic_records_dni_unique` (`dni`);

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

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

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

--
-- AUTO_INCREMENT de las tablas volcadas
--

--
-- AUTO_INCREMENT de la tabla `academic_records`
--
ALTER TABLE `academic_records`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT de la tabla `custom_fields`
--
ALTER TABLE `custom_fields`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT de la tabla `migrations`
--
ALTER TABLE `migrations`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT de la tabla `users`
--
ALTER TABLE `users`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
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 */;
