-- https://www.phpmyadmin.net/
--

START TRANSACTION;



--
-- Database: `sisgestionescolarlaravel`
--

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

--
-- Table structure for table `asignacions`
--

CREATE TABLE IF NOT EXISTS `asignacions` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `personal_id` bigint UNSIGNED NOT NULL,
  `gestion_id` bigint UNSIGNED NOT NULL,
  `nivel_id` bigint UNSIGNED NOT NULL,
  `grado_id` bigint UNSIGNED NOT NULL,
  `paralelo_id` bigint UNSIGNED NOT NULL,
  `materia_id` bigint UNSIGNED NOT NULL,
  `turno_id` bigint UNSIGNED NOT NULL,
  `estado` enum('activo','inactivo') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'activo',
  `fecha_asignacion` date NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `asignacions_personal_id_foreign` (`personal_id`),
  KEY `asignacions_gestion_id_foreign` (`gestion_id`),
  KEY `asignacions_nivel_id_foreign` (`nivel_id`),
  KEY `asignacions_grado_id_foreign` (`grado_id`),
  KEY `asignacions_paralelo_id_foreign` (`paralelo_id`),
  KEY `asignacions_materia_id_foreign` (`materia_id`),
  KEY `asignacions_turno_id_foreign` (`turno_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `asignacions`
--

INSERT INTO `asignacions` (`id`, `personal_id`, `gestion_id`, `nivel_id`, `grado_id`, `paralelo_id`, `materia_id`, `turno_id`, `estado`, `fecha_asignacion`, `created_at`, `updated_at`) VALUES
(1, 7, 2, 2, 2, 2, 1, 1, 'activo', '2025-06-16', '2025-06-16 19:32:34', '2025-06-16 19:32:34');

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

--
-- Table structure for table `asistencias`
--

CREATE TABLE IF NOT EXISTS `asistencias` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `asignacion_id` bigint UNSIGNED NOT NULL,
  `fecha` date NOT NULL,
  `observacion` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `asistencias_asignacion_id_foreign` (`asignacion_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `asistencias`
--

INSERT INTO `asistencias` (`id`, `asignacion_id`, `fecha`, `observacion`, `created_at`, `updated_at`) VALUES
(1, 1, '2025-06-16', 'Cumple con la asistencia', '2025-06-16 22:10:07', '2025-06-16 22:10:07');

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

--
-- Table structure for table `calificacions`
--

CREATE TABLE IF NOT EXISTS `calificacions` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `asignacion_id` bigint UNSIGNED NOT NULL,
  `periodo_id` bigint UNSIGNED NOT NULL,
  `tipo` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `descripcion` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `fecha` date NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `calificacions_asignacion_id_foreign` (`asignacion_id`),
  KEY `calificacions_periodo_id_foreign` (`periodo_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `calificacions`
--

INSERT INTO `calificacions` (`id`, `asignacion_id`, `periodo_id`, `tipo`, `descripcion`, `fecha`, `created_at`, `updated_at`) VALUES
(1, 1, 5, 'Acumulado', 'Acumulado del primer corte', '2025-06-16', '2025-06-16 19:34:07', '2025-06-16 19:34:07'),
(2, 1, 5, 'Examen', 'Examen final', '2025-06-16', '2025-06-16 19:34:20', '2025-06-16 19:34:20');

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

--
-- Table structure for table `configuracions`
--

CREATE TABLE IF NOT EXISTS `configuracions` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `descripcion` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `direccion` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `telefono` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `divisa` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `correo_electronico` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `web` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `logo` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `configuracions`
--

INSERT INTO `configuracions` (`id`, `nombre`, `descripcion`, `direccion`, `telefono`, `divisa`, `correo_electronico`, `web`, `logo`, `created_at`, `updated_at`) VALUES
(1, 'Colegio Educativo Uriel Reyes', 'Colegio', 'Tipitapa Managua, Iglesia Catolica', '22956853', 'C$', 'felixjmm89@hotmail.com', 'soportemiranda.com', 'uploads/logos/1750189433.jpg', '2025-06-16 16:40:48', '2025-06-17 19:43:53');

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

--
-- Table structure for table `detalle_asistencias`
--

CREATE TABLE IF NOT EXISTS `detalle_asistencias` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `asistencia_id` bigint UNSIGNED NOT NULL,
  `estudiante_id` bigint UNSIGNED NOT NULL,
  `estado_asistencia` enum('PRESENTE','FALTA','ATRASADO','PERMISO') COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `detalle_asistencias_asistencia_id_foreign` (`asistencia_id`),
  KEY `detalle_asistencias_estudiante_id_foreign` (`estudiante_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `detalle_asistencias`
--

INSERT INTO `detalle_asistencias` (`id`, `asistencia_id`, `estudiante_id`, `estado_asistencia`, `created_at`, `updated_at`) VALUES
(1, 1, 1, 'PRESENTE', '2025-06-16 22:10:07', '2025-06-16 22:10:07');

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

--
-- Table structure for table `detalle_calificacions`
--

CREATE TABLE IF NOT EXISTS `detalle_calificacions` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `calificacion_id` bigint UNSIGNED NOT NULL,
  `estudiante_id` bigint UNSIGNED NOT NULL,
  `nota` decimal(5,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `detalle_calificacions_calificacion_id_foreign` (`calificacion_id`),
  KEY `detalle_calificacions_estudiante_id_foreign` (`estudiante_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `detalle_calificacions`
--

INSERT INTO `detalle_calificacions` (`id`, `calificacion_id`, `estudiante_id`, `nota`, `created_at`, `updated_at`) VALUES
(1, 1, 1, 60.00, '2025-06-16 19:34:07', '2025-06-16 19:34:07'),
(2, 2, 1, 40.00, '2025-06-16 19:34:20', '2025-06-16 19:34:20');

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

--
-- Table structure for table `estudiantes`
--

CREATE TABLE IF NOT EXISTS `estudiantes` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `usuario_id` bigint UNSIGNED NOT NULL,
  `ppff_id` bigint UNSIGNED NOT NULL,
  `nombres` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `apellidos` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `ci` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `fecha_nacimiento` date NOT NULL,
  `direccion` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `telefono` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `foto` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `genero` enum('Masculino','Femenino') COLLATE utf8mb4_unicode_ci NOT NULL,
  `estado` enum('Activo','Inactivo') COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `estudiantes_ci_unique` (`ci`),
  KEY `estudiantes_usuario_id_foreign` (`usuario_id`),
  KEY `estudiantes_ppff_id_foreign` (`ppff_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `estudiantes`
--

INSERT INTO `estudiantes` (`id`, `usuario_id`, `ppff_id`, `nombres`, `apellidos`, `ci`, `fecha_nacimiento`, `direccion`, `telefono`, `foto`, `genero`, `estado`, `created_at`, `updated_at`) VALUES
(1, 17, 1, 'IKER MATIAS', 'ORDOÑEZ MORALES', '0000001', '2025-06-16', 'Barrio Mexico Tipitapa', '84537961', 'uploads/fotos/estudiantes/1750101637.1748521832.administrador.png', 'Masculino', 'Activo', '2025-06-16 19:20:37', '2025-06-16 19:20:37');

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

--
-- Table structure for table `failed_jobs`
--

CREATE TABLE IF NOT EXISTS `failed_jobs` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `connection` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `queue` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `formacions`
--

CREATE TABLE IF NOT EXISTS `formacions` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `personal_id` bigint UNSIGNED NOT NULL,
  `titulo` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `institucion` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `nivel` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `fecha_graduacion` date NOT NULL,
  `archivo` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `formacions_personal_id_foreign` (`personal_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `formacions`
--

INSERT INTO `formacions` (`id`, `personal_id`, `titulo`, `institucion`, `nivel`, `fecha_graduacion`, `archivo`, `created_at`, `updated_at`) VALUES
(1, 1, 'Master SQL', 'ANTEDU', 'Maestría', '2025-06-17', 'uploads/formaciones/1750186177.1748521832.administrador.png', '2025-06-17 18:49:37', '2025-06-17 18:49:37');

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

--
-- Table structure for table `gestions`
--

CREATE TABLE IF NOT EXISTS `gestions` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `gestions_nombre_unique` (`nombre`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `gestions`
--

INSERT INTO `gestions` (`id`, `nombre`, `created_at`, `updated_at`) VALUES
(1, '2024', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(2, '2025', '2025-06-16 16:40:48', '2025-06-16 16:40:48');

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

--
-- Table structure for table `grados`
--

CREATE TABLE IF NOT EXISTS `grados` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `nivel_id` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `grados_nivel_id_foreign` (`nivel_id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `grados`
--

INSERT INTO `grados` (`id`, `nombre`, `nivel_id`, `created_at`, `updated_at`) VALUES
(1, 'PREESCOLAR ', 1, '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(2, 'PRIMERO', 2, '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(3, 'SEGUNDO', 2, '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(4, 'TERCERO', 2, '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(5, 'CUARTO', 2, '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(6, 'QUINTO', 2, '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(7, 'SEXTO', 2, '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(8, 'SEPTIMO', 3, '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(9, 'OCTAVO', 3, '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(10, 'NOVENO', 3, '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(11, 'DECIMO', 3, '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(12, 'UNDECIMO', 3, '2025-06-16 16:40:48', '2025-06-16 16:40:48');

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

--
-- Table structure for table `jobs`
--

CREATE TABLE IF NOT EXISTS `jobs` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `queue` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `attempts` tinyint UNSIGNED NOT NULL,
  `reserved_at` int UNSIGNED DEFAULT NULL,
  `available_at` int UNSIGNED NOT NULL,
  `created_at` int UNSIGNED NOT NULL,
  PRIMARY KEY (`id`),
  KEY `jobs_queue_index` (`queue`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `job_batches`
--

CREATE TABLE IF NOT EXISTS `job_batches` (
  `id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `total_jobs` int NOT NULL,
  `pending_jobs` int NOT NULL,
  `failed_jobs` int NOT NULL,
  `failed_job_ids` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `options` mediumtext COLLATE utf8mb4_unicode_ci,
  `cancelled_at` int DEFAULT NULL,
  `created_at` int NOT NULL,
  `finished_at` int DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `kardexes`
--

CREATE TABLE IF NOT EXISTS `kardexes` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `estudiante_id` bigint UNSIGNED NOT NULL,
  `asignacion_id` bigint UNSIGNED NOT NULL,
  `periodo_id` bigint UNSIGNED NOT NULL,
  `observacion` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `nota` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `archivo` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `fecha` date NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `kardexes_estudiante_id_foreign` (`estudiante_id`),
  KEY `kardexes_asignacion_id_foreign` (`asignacion_id`),
  KEY `kardexes_periodo_id_foreign` (`periodo_id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `kardexes`
--

INSERT INTO `kardexes` (`id`, `estudiante_id`, `asignacion_id`, `periodo_id`, `observacion`, `nota`, `archivo`, `fecha`, `created_at`, `updated_at`) VALUES
(5, 1, 1, 5, 'Asignaciones', 'Se actualiza cronograma', 'uploads/kardexs/1750521267_Calendario-de-Examenes-II-parcial_Pagina_1-2048x1248.png', '2025-06-21', '2025-06-21 15:31:36', '2025-06-21 15:54:27');

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

--
-- Table structure for table `materias`
--

CREATE TABLE IF NOT EXISTS `materias` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `materias_nombre_unique` (`nombre`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `materias`
--

INSERT INTO `materias` (`id`, `nombre`, `created_at`, `updated_at`) VALUES
(1, 'MATEMATICA', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(2, 'ESPAÑOL', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(3, 'SOCIALES', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(4, 'CIENCIAS NATURALES', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(5, 'EDUCACION FISICA', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(6, 'INGLES', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(7, 'EDUCACION ARTISTICA', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(8, 'MUSICA', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(9, 'COMPUTACION', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(10, 'ETICA', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(11, 'RELIGION', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(12, 'CIVICA', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(13, 'BIOLOGIA', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(14, 'QUIMICA', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(15, 'FISICA', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(16, 'HISTORIA', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(17, 'GEOGRAFIA', '2025-06-16 16:40:48', '2025-06-16 16:40:48');

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

--
-- Table structure for table `matriculacions`
--

CREATE TABLE IF NOT EXISTS `matriculacions` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `estudiante_id` bigint UNSIGNED NOT NULL,
  `turno_id` bigint UNSIGNED NOT NULL,
  `gestion_id` bigint UNSIGNED NOT NULL,
  `nivel_id` bigint UNSIGNED NOT NULL,
  `grado_id` bigint UNSIGNED NOT NULL,
  `paralelo_id` bigint UNSIGNED NOT NULL,
  `fecha_matriculacion` date NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `matriculacions_estudiante_id_foreign` (`estudiante_id`),
  KEY `matriculacions_turno_id_foreign` (`turno_id`),
  KEY `matriculacions_gestion_id_foreign` (`gestion_id`),
  KEY `matriculacions_nivel_id_foreign` (`nivel_id`),
  KEY `matriculacions_grado_id_foreign` (`grado_id`),
  KEY `matriculacions_paralelo_id_foreign` (`paralelo_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `matriculacions`
--

INSERT INTO `matriculacions` (`id`, `estudiante_id`, `turno_id`, `gestion_id`, `nivel_id`, `grado_id`, `paralelo_id`, `fecha_matriculacion`, `created_at`, `updated_at`) VALUES
(1, 1, 1, 1, 1, 1, 1, '2024-01-16', '2025-06-16 19:21:32', '2025-06-16 19:21:32'),
(2, 1, 1, 2, 2, 2, 2, '2025-01-16', '2025-06-16 19:21:55', '2025-06-16 19:21:55');

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

--
-- Table structure for table `migrations`
--

CREATE TABLE IF NOT EXISTS `migrations` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `migrations`
--

INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '0001_01_01_000000_create_users_table', 1),
(2, '0001_01_01_000001_create_cache_table', 1),
(3, '0001_01_01_000002_create_jobs_table', 1),
(4, '2025_05_14_180446_create_configuracions_table', 1),
(5, '2025_05_17_152852_create_gestions_table', 1),
(6, '2025_05_18_011016_create_nivels_table', 1),
(7, '2025_05_18_181002_create_turnos_table', 1),
(8, '2025_05_19_010329_create_periodos_table', 1),
(9, '2025_05_19_123225_create_grados_table', 1),
(10, '2025_05_22_120717_create_paralelos_table', 1),
(11, '2025_05_22_191558_create_materias_table', 1),
(12, '2025_05_23_002252_create_permission_tables', 1),
(13, '2025_05_23_131206_create_personals_table', 1),
(14, '2025_05_25_014050_create_formacions_table', 1),
(15, '2025_05_27_003311_create_ppffs_table', 1),
(16, '2025_05_27_003340_create_estudiantes_table', 1),
(17, '2025_05_30_010408_create_matriculacions_table', 1),
(18, '2025_06_03_100348_create_asignacions_table', 1),
(19, '2025_06_06_190351_create_pagos_table', 1),
(20, '2025_06_07_180404_create_asistencias_table', 1),
(21, '2025_06_07_180501_create_detalle_asistencias_table', 1),
(22, '2025_06_12_193525_create_calificacions_table', 1),
(23, '2025_06_12_193603_create_detalle_calificacions_table', 1),
(24, '2025_06_15_092123_create_kardexes_table', 1);

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

--
-- Table structure for table `model_has_permissions`
--

CREATE TABLE IF NOT EXISTS `model_has_permissions` (
  `permission_id` bigint UNSIGNED NOT NULL,
  `model_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `model_id` bigint UNSIGNED NOT NULL,
  PRIMARY KEY (`permission_id`,`model_id`,`model_type`),
  KEY `model_has_permissions_model_id_model_type_index` (`model_id`,`model_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `model_has_roles`
--

CREATE TABLE IF NOT EXISTS `model_has_roles` (
  `role_id` bigint UNSIGNED NOT NULL,
  `model_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `model_id` bigint UNSIGNED NOT NULL,
  PRIMARY KEY (`role_id`,`model_id`,`model_type`),
  KEY `model_has_roles_model_id_model_type_index` (`model_id`,`model_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `model_has_roles`
--

INSERT INTO `model_has_roles` (`role_id`, `model_type`, `model_id`) VALUES
(1, 'App\\Models\\User', 1),
(2, 'App\\Models\\User', 2),
(4, 'App\\Models\\User', 3),
(3, 'App\\Models\\User', 4),
(8, 'App\\Models\\User', 5),
(7, 'App\\Models\\User', 6),
(5, 'App\\Models\\User', 8),
(5, 'App\\Models\\User', 9),
(5, 'App\\Models\\User', 10),
(5, 'App\\Models\\User', 11),
(5, 'App\\Models\\User', 12),
(5, 'App\\Models\\User', 13),
(5, 'App\\Models\\User', 14),
(2, 'App\\Models\\User', 16),
(6, 'App\\Models\\User', 17);

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

--
-- Table structure for table `nivels`
--

CREATE TABLE IF NOT EXISTS `nivels` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `nivels_nombre_unique` (`nombre`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `nivels`
--

INSERT INTO `nivels` (`id`, `nombre`, `created_at`, `updated_at`) VALUES
(1, 'PREESCOLAR', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(2, 'PRIMARIA', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(3, 'SECUNDARIA', '2025-06-16 16:40:48', '2025-06-16 16:40:48');

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

--
-- Table structure for table `pagos`
--

CREATE TABLE IF NOT EXISTS `pagos` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `matriculacion_id` bigint UNSIGNED NOT NULL,
  `monto` decimal(10,2) NOT NULL,
  `metodo_pago` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `descripcion` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `fecha_pago` date NOT NULL,
  `estado` enum('pendiente','completado','cancelado','anulado') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'cancelado',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `pagos_matriculacion_id_foreign` (`matriculacion_id`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `pagos`
--

INSERT INTO `pagos` (`id`, `matriculacion_id`, `monto`, `metodo_pago`, `descripcion`, `fecha_pago`, `estado`, `created_at`, `updated_at`) VALUES
(1, 1, 600.00, 'Efectivo', 'ENERO', '2024-01-16', 'cancelado', '2025-06-16 19:22:22', '2025-06-16 19:23:12'),
(2, 1, 600.00, 'Efectivo', 'FEBRERO', '2024-02-16', 'cancelado', '2025-06-16 19:22:22', '2025-06-16 19:24:28'),
(3, 1, 600.00, 'Efectivo', 'MARZO', '2024-03-16', 'cancelado', '2025-06-16 19:22:22', '2025-06-16 19:24:50'),
(4, 1, 600.00, 'Efectivo', 'ABRIL', '2024-04-16', 'cancelado', '2025-06-16 19:22:22', '2025-06-16 19:25:09'),
(5, 1, 600.00, 'Efectivo', 'MAYO', '2024-05-16', 'cancelado', '2025-06-16 19:22:22', '2025-06-16 19:25:25'),
(6, 1, 600.00, 'Efectivo', 'JUNIO', '2024-06-16', 'cancelado', '2025-06-16 19:22:22', '2025-06-16 19:25:41'),
(7, 2, 700.00, 'Efectivo', 'ENERO', '2025-01-16', 'cancelado', '2025-06-16 19:22:22', '2025-06-16 19:30:38'),
(8, 2, 700.00, 'Efectivo', 'FEBRERO', '2025-02-16', 'cancelado', '2025-06-16 19:22:22', '2025-06-16 19:30:55'),
(9, 2, 700.00, 'Efectivo', 'MARZO', '2025-03-16', 'cancelado', '2025-06-16 19:22:22', '2025-06-16 19:31:11'),
(10, 2, 700.00, 'Efectivo', 'ABRIL', '2025-04-16', 'cancelado', '2025-06-16 19:22:22', '2025-06-16 19:31:27'),
(11, 2, 700.00, 'Efectivo', 'MAYO', '2025-05-16', 'cancelado', '2025-06-16 19:22:22', '2025-06-16 19:31:42'),
(12, 2, 700.00, 'Efectivo', 'JUNIO', '2025-05-16', 'cancelado', '2025-06-16 19:22:22', '2025-06-20 13:55:35'),
(13, 1, 6000.00, 'Efectivo', 'MATRICULA', '2024-01-16', 'cancelado', '2025-06-16 19:22:55', '2025-06-16 19:22:55'),
(14, 1, 600.00, 'Efectivo', 'JULIO', '2024-07-16', 'cancelado', '2025-06-16 19:25:59', '2025-06-16 19:25:59'),
(15, 1, 600.00, 'Efectivo', 'AGOSTO', '2024-08-16', 'cancelado', '2025-06-16 19:28:28', '2025-06-16 19:28:28'),
(16, 1, 600.00, 'Efectivo', 'SEPTIEMBRE', '2024-09-16', 'cancelado', '2025-06-16 19:28:44', '2025-06-16 19:28:44'),
(17, 1, 600.00, 'Efectivo', 'OCTUBRE', '2024-10-16', 'cancelado', '2025-06-16 19:29:08', '2025-06-16 19:29:08'),
(18, 1, 600.00, 'Efectivo', 'NOVIEMBRE', '2024-11-16', 'cancelado', '2025-06-16 19:29:24', '2025-06-16 19:29:24'),
(19, 1, 600.00, 'Efectivo', 'DICIEMBRE', '2024-12-16', 'cancelado', '2025-06-16 19:29:44', '2025-06-16 19:29:44'),
(20, 2, 4000.00, 'Transferencia', 'MATRICULA', '2025-01-16', 'cancelado', '2025-06-16 19:30:23', '2025-06-16 19:30:23');

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

--
-- Table structure for table `paralelos`
--

CREATE TABLE IF NOT EXISTS `paralelos` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `grado_id` bigint UNSIGNED NOT NULL,
  `nombre` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `paralelos_grado_id_foreign` (`grado_id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `paralelos`
--

INSERT INTO `paralelos` (`id`, `grado_id`, `nombre`, `created_at`, `updated_at`) VALUES
(1, 1, 'A', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(2, 2, 'A', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(3, 3, 'A', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(4, 4, 'A', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(5, 5, 'A', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(6, 6, 'A', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(7, 7, 'A', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(8, 8, 'A', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(10, 9, 'A', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(11, 10, 'A', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(12, 11, 'A', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(13, 12, 'A', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(14, 9, 'B', '2025-06-16 18:56:29', '2025-06-16 18:56:29');

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

--
-- Table structure for table `periodos`
--

CREATE TABLE IF NOT EXISTS `periodos` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `gestion_id` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `periodos_gestion_id_foreign` (`gestion_id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `periodos`
--

INSERT INTO `periodos` (`id`, `nombre`, `gestion_id`, `created_at`, `updated_at`) VALUES
(1, '1 CORTE', 1, '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(2, '2 CORTE', 1, '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(3, '3 CORTE', 1, '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(4, '4 CORTE', 1, '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(5, '1 CORTE', 2, '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(6, '2 CORTE', 2, '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(7, '3 CORTE', 2, '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(8, '4 CORTE', 2, '2025-06-16 16:40:48', '2025-06-16 16:40:48');

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

--
-- Table structure for table `permissions`
--

CREATE TABLE IF NOT EXISTS `permissions` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `guard_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `permissions_name_guard_name_unique` (`name`,`guard_name`)
) ENGINE=InnoDB AUTO_INCREMENT=120 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `permissions`
--

INSERT INTO `permissions` (`id`, `name`, `guard_name`, `created_at`, `updated_at`) VALUES
(1, 'admin.configuracion.index', 'web', '2025-06-16 16:40:46', '2025-06-16 16:40:46'),
(2, 'admin.configuracion.store', 'web', '2025-06-16 16:40:46', '2025-06-16 16:40:46'),
(3, 'admin.gestiones.index', 'web', '2025-06-16 16:40:46', '2025-06-16 16:40:46'),
(4, 'admin.gestiones.create', 'web', '2025-06-16 16:40:46', '2025-06-16 16:40:46'),
(5, 'admin.gestiones.store', 'web', '2025-06-16 16:40:46', '2025-06-16 16:40:46'),
(6, 'admin.gestiones.edit', 'web', '2025-06-16 16:40:46', '2025-06-16 16:40:46'),
(7, 'admin.gestiones.update', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(8, 'admin.gestiones.destroy', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(9, 'admin.periodos.index', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(10, 'admin.periodos.store', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(11, 'admin.periodos.update', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(12, 'admin.periodos.destroy', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(13, 'admin.niveles.index', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(14, 'admin.niveles.store', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(15, 'admin.niveles.update', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(16, 'admin.niveles.destroy', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(17, 'admin.grados.index', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(18, 'admin.grados.store', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(19, 'admin.grados.update', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(20, 'admin.grados.destroy', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(21, 'admin.paralelos.index', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(22, 'admin.paralelos.store', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(23, 'admin.paralelos.update', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(24, 'admin.paralelos.destroy', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(25, 'admin.turnos.index', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(26, 'admin.turnos.create', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(27, 'admin.turnos.store', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(28, 'admin.turnos.edit', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(29, 'admin.turnos.update', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(30, 'admin.turnos.destroy', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(31, 'admin.materias.index', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(32, 'admin.materias.store', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(33, 'admin.materias.update', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(34, 'admin.materias.destroy', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(35, 'admin.roles.index', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(36, 'admin.roles.create', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(37, 'admin.roles.store', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(38, 'admin.roles.edit', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(39, 'admin.roles.permisos', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(40, 'admin.roles.update_permisos', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(41, 'admin.roles.update', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(42, 'admin.roles.destroy', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(43, 'admin.personal.index', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(44, 'admin.personal.create', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(45, 'admin.personal.store', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(46, 'admin.personal.show', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(47, 'admin.personal.edit', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(48, 'admin.personal.update', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(49, 'admin.personal.destroy', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(50, 'admin.personal.activar', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(51, 'admin.personal.inactivar', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(52, 'admin.formaciones.index', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(53, 'admin.formaciones.create', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(54, 'admin.formaciones.store', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(55, 'admin.formaciones.edit', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(56, 'admin.formaciones.update', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(57, 'admin.formaciones.destroy', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(58, 'admin.estudiantes.index', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(59, 'admin.estudiantes.create', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(60, 'admin.estudiantes.store', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(61, 'admin.estudiantes.show', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(62, 'admin.estudiantes.edit', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(63, 'admin.estudiantes.update', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(64, 'admin.estudiantes.destroy', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(65, 'admin.estudiantes.activar', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(66, 'admin.estudiantes.inactivar', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(67, 'admin.ppffs.index', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(68, 'admin.estudiantes.ppffs.store', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(69, 'admin.ppffs.create', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(70, 'admin.ppffs.store', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(71, 'admin.ppffs.show', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(72, 'admin.ppffs.edit', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(73, 'admin.ppffs.update', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(74, 'admin.ppffs.destroy', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(75, 'admin.matriculaciones.index', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(76, 'admin.matriculaciones.create', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(77, 'admin.matriculaciones.buscar_estudiante', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(78, 'admin.matriculaciones.store', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(79, 'admin.matriculaciones.buscar_grados', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(80, 'admin.matriculaciones.buscar_paralelos', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(81, 'admin.matriculaciones.pdf_matricula', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(82, 'admin.matriculaciones.show', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(83, 'admin.matriculaciones.edit', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(84, 'admin.matriculaciones.update', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(85, 'admin.matriculaciones.destroy', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(86, 'admin.asignaciones.index', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(87, 'admin.asignaciones.create', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(88, 'admin.asignaciones.store', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(89, 'admin.asignaciones.buscar_docente', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(90, 'admin.asignaciones.show', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(91, 'admin.asignaciones.edit', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(92, 'admin.asignaciones.update', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(93, 'admin.asignaciones.destroy', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(94, 'admin.pagos.index', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(95, 'admin.pagos.ver_pagos', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(96, 'admin.pagos.store', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(97, 'admin.pagos.comprobante', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(98, 'admin.pagos.destroy', 'web', '2025-06-16 16:40:47', '2025-06-16 16:40:47'),
(99, 'admin.asistencias.index', 'web', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(100, 'admin.asistencias.create', 'web', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(101, 'admin.asistencias.show', 'web', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(102, 'admin.asistencias.show_estudiante', 'web', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(103, 'admin.asistencias.store', 'web', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(104, 'admin.asistencias.update', 'web', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(105, 'admin.asistencias.destroy', 'web', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(106, 'admin.calificaciones.index', 'web', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(107, 'admin.calificaciones.create', 'web', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(108, 'admin.calificaciones.store', 'web', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(109, 'admin.calificaciones.update', 'web', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(110, 'admin.calificaciones.show_estudiante', 'web', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(111, 'admin.calificaciones.show_admin', 'web', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(112, 'admin.calificaciones.destroy', 'web', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(113, 'admin.kardexs.index', 'web', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(114, 'admin.kardexs.create', 'web', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(115, 'admin.kardexs.show_admin', 'web', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(116, 'admin.kardexs.store', 'web', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(117, 'admin.kardexs.update', 'web', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(118, 'admin.kardexs.destroy', 'web', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(119, 'admin.kardexs.show_estudiante', 'web', '2025-06-16 16:40:48', '2025-06-16 16:40:48');

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

--
-- Table structure for table `personals`
--

CREATE TABLE IF NOT EXISTS `personals` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `usuario_id` bigint UNSIGNED NOT NULL,
  `tipo` enum('docente','administrativo') COLLATE utf8mb4_unicode_ci NOT NULL,
  `nombres` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `apellidos` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `ci` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `fecha_nacimiento` date NOT NULL,
  `direccion` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `telefono` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `profesion` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `foto` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `personals_ci_unique` (`ci`),
  UNIQUE KEY `personals_telefono_unique` (`telefono`),
  KEY `personals_usuario_id_foreign` (`usuario_id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `personals`
--

INSERT INTO `personals` (`id`, `usuario_id`, `tipo`, `nombres`, `apellidos`, `ci`, `fecha_nacimiento`, `direccion`, `telefono`, `profesion`, `foto`, `created_at`, `updated_at`) VALUES
(1, 1, 'administrativo', 'Felix Javier', 'Morales Miranda', '123456789', '1989-01-01', 'Tipitapa Managua, Iglesia Catolica', '84537961', 'Ingeniero en Sistemas', 'uploads/fotos/administrador.png', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(2, 3, 'administrativo', 'Marvin Javier', 'Miranda Miranda', '1234', '1989-01-01', 'Tipitapa Managua, Iglesia Catolica', '85740732', 'Ingeniero en Telecomunicaciones', 'uploads/fotos/administrador.png', '2025-06-16 16:40:49', '2025-06-16 16:40:49'),
(3, 4, 'administrativo', 'Carlos Javier', 'Morales Solorzano', '12345', '1959-01-01', 'Tipitapa Managua, Iglesia Catolica', '88334567', 'Licenciado en Educacion', 'uploads/fotos/administrador.png', '2025-06-16 16:40:49', '2025-06-16 16:40:49'),
(4, 5, 'administrativo', 'Maria de los Angeles', 'Miranda Vargas', '123456', '1960-01-01', 'Tipitapa Managua, Iglesia Catolica', '88860306', 'Licenciada en Contabilidad', 'uploads/fotos/administrador.png', '2025-06-16 16:40:49', '2025-06-16 16:40:49'),
(5, 6, 'administrativo', 'Karla de los Angeles', 'Morales Miranda', '000000', '1982-01-01', 'Tipitapa Managua, Iglesia Catolica', '84547222', 'Medico', 'uploads/fotos/administrador.png', '2025-06-16 16:40:49', '2025-06-16 16:40:49'),
(7, 8, 'docente', 'Maria Jose', 'Fernandez Castillo', '0023221', '1990-01-01', 'Tipitapa Managua, Iglesia Catolica', '79123456', 'Ingeniero en telecomunicaciones', 'uploads/fotos/administrador.png', '2025-06-16 16:40:50', '2025-06-16 16:40:50'),
(8, 9, 'docente', 'Ricardo Jose', 'Montenegro Castillo', '00232215', '1990-01-01', 'Tipitapa Managua, Iglesia Catolica', '70011223', 'Ingeniero en telecomunicaciones', 'uploads/fotos/administrador.png', '2025-06-16 16:40:50', '2025-06-16 16:40:50'),
(9, 10, 'docente', 'Carlos Jose', 'Rios Castillo', '00232216', '1990-01-01', 'Tipitapa Managua, Iglesia Catolica', '71234567', 'Ingeniero en telecomunicaciones', 'uploads/fotos/administrador.png', '2025-06-16 16:40:50', '2025-06-16 16:40:50'),
(10, 11, 'docente', 'Ana Elizabeth', 'Morales Castillo', '00232217', '1990-01-01', 'Tipitapa Managua, Iglesia Catolica', '76898767', 'Ingeniero en telecomunicaciones', 'uploads/fotos/administrador.png', '2025-06-16 16:40:50', '2025-06-16 16:40:50'),
(11, 12, 'docente', 'Jorge Elizabeth', 'Pacheco Castillo', '002322178', '1990-01-01', 'Tipitapa Managua, Iglesia Catolica', '76898761', 'Ingeniero en telecomunicaciones', 'uploads/fotos/administrador.png', '2025-06-16 16:40:50', '2025-06-16 16:40:50'),
(12, 13, 'docente', 'Lucia Elizabeth', 'Mendoza Castillo', '456789', '1990-01-01', 'Tipitapa Managua, Iglesia Catolica', '74567890', 'Ingeniero en telecomunicaciones', 'uploads/fotos/administrador.png', '2025-06-16 16:40:51', '2025-06-16 16:40:51'),
(13, 14, 'docente', 'Alberto Joaquin', 'Mendoza Castillo', '2345678', '1990-01-01', 'Tipitapa Managua, Iglesia Catolica', '75678901', 'Ingeniero en telecomunicaciones', 'uploads/fotos/administrador.png', '2025-06-16 16:40:51', '2025-06-16 16:40:51'),
(15, 16, 'administrativo', 'Javier', 'Morales Miranda', '0030405890000K', '1989-05-05', 'Barrio Mexico Tipitapa', '84537962', 'INGENIERO EN SISTEMAS', 'uploads/fotos/1750093084.png', '2025-06-16 16:58:04', '2025-06-16 16:58:04');

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

--
-- Table structure for table `ppffs`
--

CREATE TABLE IF NOT EXISTS `ppffs` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `nombres` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `apellidos` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `ci` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `fecha_nacimiento` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `telefono` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `parentesco` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `ocupacion` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `direccion` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ppffs_ci_unique` (`ci`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `ppffs`
--

INSERT INTO `ppffs` (`id`, `nombres`, `apellidos`, `ci`, `fecha_nacimiento`, `telefono`, `parentesco`, `ocupacion`, `direccion`, `email`, `created_at`, `updated_at`) VALUES
(1, 'MARIA DE LOS ANGELES', 'MIRANDA VARGAS', '00130707580006G', '2025-06-16', '88860306', 'ABUELITA', 'AMA DE CASA', 'Tipitapa-Managua', 'Mariamiranda@icloud.com', '2025-06-16 19:20:03', '2025-06-16 19:20:03');

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

--
-- Table structure for table `roles`
--

CREATE TABLE IF NOT EXISTS `roles` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `guard_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `roles_name_guard_name_unique` (`name`,`guard_name`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `roles`
--

INSERT INTO `roles` (`id`, `name`, `guard_name`, `created_at`, `updated_at`) VALUES
(1, 'ADMINISTRADOR', 'web', '2025-06-16 16:40:46', '2025-06-16 16:40:46'),
(2, 'DIRECTOR GENERAL', 'web', '2025-06-16 16:40:46', '2025-06-16 16:40:46'),
(3, 'DIRECTOR ACADÉMICO', 'web', '2025-06-16 16:40:46', '2025-06-16 16:40:46'),
(4, 'DIRECTOR ADMINISTRATIVO', 'web', '2025-06-16 16:40:46', '2025-06-16 16:40:46'),
(5, 'DOCENTE', 'web', '2025-06-16 16:40:46', '2025-06-16 16:40:46'),
(6, 'ESTUDIANTE', 'web', '2025-06-16 16:40:46', '2025-06-16 16:40:46'),
(7, 'CAJERO', 'web', '2025-06-16 16:40:46', '2025-06-16 16:40:46'),
(8, 'SECRETARIA', 'web', '2025-06-16 16:40:46', '2025-06-16 16:40:46');

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

--
-- Table structure for table `role_has_permissions`
--

CREATE TABLE IF NOT EXISTS `role_has_permissions` (
  `permission_id` bigint UNSIGNED NOT NULL,
  `role_id` bigint UNSIGNED NOT NULL,
  PRIMARY KEY (`permission_id`,`role_id`),
  KEY `role_has_permissions_role_id_foreign` (`role_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `role_has_permissions`
--

INSERT INTO `role_has_permissions` (`permission_id`, `role_id`) VALUES
(1, 1),
(2, 1),
(3, 1),
(4, 1),
(5, 1),
(6, 1),
(7, 1),
(8, 1),
(9, 1),
(10, 1),
(11, 1),
(12, 1),
(13, 1),
(14, 1),
(15, 1),
(16, 1),
(17, 1),
(18, 1),
(19, 1),
(20, 1),
(21, 1),
(22, 1),
(23, 1),
(24, 1),
(25, 1),
(26, 1),
(27, 1),
(28, 1),
(29, 1),
(30, 1),
(31, 1),
(32, 1),
(33, 1),
(34, 1),
(35, 1),
(36, 1),
(37, 1),
(38, 1),
(39, 1),
(40, 1),
(41, 1),
(42, 1),
(43, 1),
(44, 1),
(45, 1),
(46, 1),
(47, 1),
(48, 1),
(49, 1),
(50, 1),
(51, 1),
(52, 1),
(53, 1),
(54, 1),
(55, 1),
(56, 1),
(57, 1),
(58, 1),
(59, 1),
(60, 1),
(61, 1),
(62, 1),
(63, 1),
(64, 1),
(65, 1),
(66, 1),
(67, 1),
(68, 1),
(69, 1),
(70, 1),
(71, 1),
(72, 1),
(73, 1),
(74, 1),
(75, 1),
(76, 1),
(77, 1),
(78, 1),
(79, 1),
(80, 1),
(81, 1),
(82, 1),
(83, 1),
(84, 1),
(85, 1),
(86, 1),
(87, 1),
(88, 1),
(89, 1),
(90, 1),
(91, 1),
(92, 1),
(93, 1),
(94, 1),
(95, 1),
(96, 1),
(97, 1),
(98, 1),
(99, 1),
(101, 1),
(106, 1),
(111, 1),
(113, 1),
(115, 1),
(1, 2),
(2, 2),
(3, 2),
(4, 2),
(5, 2),
(6, 2),
(7, 2),
(8, 2),
(9, 2),
(10, 2),
(11, 2),
(12, 2),
(13, 2),
(14, 2),
(15, 2),
(16, 2),
(17, 2),
(18, 2),
(19, 2),
(20, 2),
(21, 2),
(22, 2),
(23, 2),
(24, 2),
(25, 2),
(26, 2),
(27, 2),
(28, 2),
(29, 2),
(30, 2),
(31, 2),
(32, 2),
(33, 2),
(34, 2),
(35, 2),
(36, 2),
(37, 2),
(38, 2),
(39, 2),
(40, 2),
(41, 2),
(42, 2),
(43, 2),
(44, 2),
(45, 2),
(46, 2),
(47, 2),
(48, 2),
(49, 2),
(50, 2),
(51, 2),
(52, 2),
(53, 2),
(54, 2),
(55, 2),
(56, 2),
(57, 2),
(58, 2),
(59, 2),
(60, 2),
(61, 2),
(62, 2),
(63, 2),
(64, 2),
(65, 2),
(66, 2),
(67, 2),
(68, 2),
(69, 2),
(70, 2),
(71, 2),
(72, 2),
(73, 2),
(74, 2),
(75, 2),
(76, 2),
(77, 2),
(78, 2),
(79, 2),
(80, 2),
(81, 2),
(82, 2),
(83, 2),
(84, 2),
(85, 2),
(86, 2),
(87, 2),
(88, 2),
(89, 2),
(90, 2),
(91, 2),
(92, 2),
(93, 2),
(94, 2),
(95, 2),
(96, 2),
(97, 2),
(98, 2),
(99, 2),
(100, 2),
(101, 2),
(102, 2),
(103, 2),
(104, 2),
(105, 2),
(106, 2),
(107, 2),
(108, 2),
(109, 2),
(110, 2),
(111, 2),
(112, 2),
(113, 2),
(114, 2),
(115, 2),
(116, 2),
(117, 2),
(118, 2),
(119, 2),
(99, 5),
(100, 5),
(103, 5),
(104, 5),
(105, 5),
(106, 5),
(107, 5),
(108, 5),
(109, 5),
(112, 5),
(113, 5),
(114, 5),
(116, 5),
(117, 5),
(118, 5),
(99, 6),
(102, 6),
(106, 6),
(110, 6),
(113, 6),
(119, 6),
(94, 7),
(95, 7),
(96, 7),
(97, 7),
(98, 7);

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

--
-- Table structure for table `sessions`
--

CREATE TABLE IF NOT EXISTS `sessions` (
  `id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` bigint UNSIGNED DEFAULT NULL,
  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` text COLLATE utf8mb4_unicode_ci,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `last_activity` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `sessions_user_id_index` (`user_id`),
  KEY `sessions_last_activity_index` (`last_activity`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sessions`
--

INSERT INTO `sessions` (`id`, `user_id`, `ip_address`, `user_agent`, `payload`, `last_activity`) VALUES
('35mUPjPF2PHS9fyPtFo22uH6jhOUyFBJeGHfZCIf', 1, '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36 Edg/137.0.0.0', 'YTo1OntzOjY6Il90b2tlbiI7czo0MDoiYUdvZVRWZ3phU1R4RHo3OHM3OGtRYXRiS1dGRnNRcjdQWXdaYUFXRCI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6NzU6Imh0dHA6Ly9sb2NhbGhvc3Qvc2lzZ2VzdGlvbmVzY29sYXJsYXJhdmVsL3B1YmxpYy9hZG1pbi9rYXJkZXhzL2FzaWduYWNpb24vMSI7fXM6NTA6ImxvZ2luX3dlYl81OWJhMzZhZGRjMmIyZjk0MDE1ODBmMDE0YzdmNThlYTRlMzA5ODlkIjtpOjE7czo0OiJhdXRoIjthOjE6e3M6MjE6InBhc3N3b3JkX2NvbmZpcm1lZF9hdCI7aToxNzUwNTIxNDE0O319', 1750522846),
('zShtKdN1I0mzS6oABbdGY8qrC68CDD0o3ERM0w8L', 8, '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36', 'YTo1OntzOjY6Il90b2tlbiI7czo0MDoiRmdXV2g0a0hWTmMwN3J2RlF1azVYYjF1Tjg1MmxDTVk3NE9JMjJWTyI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6ODI6Imh0dHA6Ly9sb2NhbGhvc3Qvc2lzZ2VzdGlvbmVzY29sYXJsYXJhdmVsL3B1YmxpYy9hZG1pbi9rYXJkZXhzL2NyZWF0ZS9hc2lnbmFjaW9uLzEiO31zOjUwOiJsb2dpbl93ZWJfNTliYTM2YWRkYzJiMmY5NDAxNTgwZjAxNGM3ZjU4ZWE0ZTMwOTg5ZCI7aTo4O3M6NDoiYXV0aCI7YToxOntzOjIxOiJwYXNzd29yZF9jb25maXJtZWRfYXQiO2k6MTc1MDUyMjI5MTt9fQ==', 1750522812);

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

--
-- Table structure for table `turnos`
--

CREATE TABLE IF NOT EXISTS `turnos` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `nombre` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `turnos_nombre_unique` (`nombre`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `turnos`
--

INSERT INTO `turnos` (`id`, `nombre`, `created_at`, `updated_at`) VALUES
(1, 'MATUTINO', '2025-06-16 16:40:48', '2025-06-16 16:40:48'),
(2, 'VESPERTINO', '2025-06-16 16:40:48', '2025-06-16 16:40:48');

--
-- Constraints for dumped tables
--

--
-- Constraints for table `asignacions`
--
ALTER TABLE `asignacions`
  ADD CONSTRAINT `asignacions_gestion_id_foreign` FOREIGN KEY (`gestion_id`) REFERENCES `gestions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `asignacions_grado_id_foreign` FOREIGN KEY (`grado_id`) REFERENCES `grados` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `asignacions_materia_id_foreign` FOREIGN KEY (`materia_id`) REFERENCES `materias` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `asignacions_nivel_id_foreign` FOREIGN KEY (`nivel_id`) REFERENCES `nivels` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `asignacions_paralelo_id_foreign` FOREIGN KEY (`paralelo_id`) REFERENCES `paralelos` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `asignacions_personal_id_foreign` FOREIGN KEY (`personal_id`) REFERENCES `personals` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `asignacions_turno_id_foreign` FOREIGN KEY (`turno_id`) REFERENCES `turnos` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `asistencias`
--
ALTER TABLE `asistencias`
  ADD CONSTRAINT `asistencias_asignacion_id_foreign` FOREIGN KEY (`asignacion_id`) REFERENCES `asignacions` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `calificacions`
--
ALTER TABLE `calificacions`
  ADD CONSTRAINT `calificacions_asignacion_id_foreign` FOREIGN KEY (`asignacion_id`) REFERENCES `asignacions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `calificacions_periodo_id_foreign` FOREIGN KEY (`periodo_id`) REFERENCES `periodos` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `detalle_asistencias`
--
ALTER TABLE `detalle_asistencias`
  ADD CONSTRAINT `detalle_asistencias_asistencia_id_foreign` FOREIGN KEY (`asistencia_id`) REFERENCES `asistencias` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `detalle_asistencias_estudiante_id_foreign` FOREIGN KEY (`estudiante_id`) REFERENCES `estudiantes` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `detalle_calificacions`
--
ALTER TABLE `detalle_calificacions`
  ADD CONSTRAINT `detalle_calificacions_calificacion_id_foreign` FOREIGN KEY (`calificacion_id`) REFERENCES `calificacions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `detalle_calificacions_estudiante_id_foreign` FOREIGN KEY (`estudiante_id`) REFERENCES `estudiantes` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `estudiantes`
--
ALTER TABLE `estudiantes`
  ADD CONSTRAINT `estudiantes_ppff_id_foreign` FOREIGN KEY (`ppff_id`) REFERENCES `ppffs` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `estudiantes_usuario_id_foreign` FOREIGN KEY (`usuario_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `formacions`
--
ALTER TABLE `formacions`
  ADD CONSTRAINT `formacions_personal_id_foreign` FOREIGN KEY (`personal_id`) REFERENCES `personals` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `grados`
--
ALTER TABLE `grados`
  ADD CONSTRAINT `grados_nivel_id_foreign` FOREIGN KEY (`nivel_id`) REFERENCES `nivels` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `kardexes`
--
ALTER TABLE `kardexes`
  ADD CONSTRAINT `kardexes_asignacion_id_foreign` FOREIGN KEY (`asignacion_id`) REFERENCES `asignacions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `kardexes_estudiante_id_foreign` FOREIGN KEY (`estudiante_id`) REFERENCES `estudiantes` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `kardexes_periodo_id_foreign` FOREIGN KEY (`periodo_id`) REFERENCES `periodos` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `matriculacions`
--
ALTER TABLE `matriculacions`
  ADD CONSTRAINT `matriculacions_estudiante_id_foreign` FOREIGN KEY (`estudiante_id`) REFERENCES `estudiantes` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `matriculacions_gestion_id_foreign` FOREIGN KEY (`gestion_id`) REFERENCES `gestions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `matriculacions_grado_id_foreign` FOREIGN KEY (`grado_id`) REFERENCES `grados` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `matriculacions_nivel_id_foreign` FOREIGN KEY (`nivel_id`) REFERENCES `nivels` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `matriculacions_paralelo_id_foreign` FOREIGN KEY (`paralelo_id`) REFERENCES `paralelos` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `matriculacions_turno_id_foreign` FOREIGN KEY (`turno_id`) REFERENCES `turnos` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `model_has_permissions`
--
ALTER TABLE `model_has_permissions`
  ADD CONSTRAINT `model_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `model_has_roles`
--
ALTER TABLE `model_has_roles`
  ADD CONSTRAINT `model_has_roles_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `pagos`
--
ALTER TABLE `pagos`
  ADD CONSTRAINT `pagos_matriculacion_id_foreign` FOREIGN KEY (`matriculacion_id`) REFERENCES `matriculacions` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `paralelos`
--
ALTER TABLE `paralelos`
  ADD CONSTRAINT `paralelos_grado_id_foreign` FOREIGN KEY (`grado_id`) REFERENCES `grados` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `periodos`
--
ALTER TABLE `periodos`
  ADD CONSTRAINT `periodos_gestion_id_foreign` FOREIGN KEY (`gestion_id`) REFERENCES `gestions` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `personals`
--
ALTER TABLE `personals`
  ADD CONSTRAINT `personals_usuario_id_foreign` FOREIGN KEY (`usuario_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `role_has_permissions`
--
ALTER TABLE `role_has_permissions`
  ADD CONSTRAINT `role_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `role_has_permissions_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE;
COMMIT;

