text: -- phpMyAdmin SQL Dump
  -- version 5.0.2
  -- https://www.phpmyadmin.net/
  --
  -- Servidor: 127.0.0.1
  -- Tiempo de generación: 28-11-2020 a las 18:30:52
  -- Versión del servidor: 10.4.11-MariaDB
  -- Versión de PHP: 7.4.5
  
  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: `php`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `class`
  --
  
  CREATE TABLE `class` (
    `id_class` int(11) NOT NULL,
    `id_teacher` int(11) NOT NULL,
    `id_course` int(11) NOT NULL,
    `id_schedule` int(11) NOT NULL,
    `name` varchar(255) NOT NULL,
    `color` varchar(10) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
  
  --
  -- Volcado de datos para la tabla `class`
  --
  
  INSERT INTO `class` (`id_class`, `id_teacher`, `id_course`, `id_schedule`, `name`, `color`) VALUES
  (1, 1, 1, 1, 'PHP', '');
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `courses`
  --
  
  CREATE TABLE `courses` (
    `id_course` int(11) NOT NULL,
    `name` varchar(255) NOT NULL,
    `description` varchar(500) NOT NULL,
    `date_start` date NOT NULL,
    `date_end` date NOT NULL,
    `active` int(11) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
  
  --
  -- Volcado de datos para la tabla `courses`
  --
  
  INSERT INTO `courses` (`id_course`, `name`, `description`, `date_start`, `date_end`, `active`) VALUES
  (1, 'DAM', 'FP de Desarrollo de aplicaciones Multiplataforma', '2020-09-15', '2021-06-20', 1),
  (2, 'DAW', 'FP de Desarrollo de aplicaciones WEB', '2020-09-15', '2021-06-20', 1);
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `enrollment`
  --
  
  CREATE TABLE `enrollment` (
    `id_enrollment` int(11) NOT NULL,
    `id_student` int(11) NOT NULL,
    `id_course` int(11) NOT NULL,
    `status` int(11) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `exams`
  --
  
  CREATE TABLE `exams` (
    `id_exam` int(11) NOT NULL,
    `id_class` int(11) NOT NULL,
    `id_student` int(11) NOT NULL,
    `name` varchar(255) NOT NULL,
    `mark` float NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `failed_jobs`
  --
  
  CREATE TABLE `failed_jobs` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `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()
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `migrations`
  --
  
  CREATE TABLE `migrations` (
    `id` int(10) UNSIGNED NOT NULL,
    `migration` varchar(255) COLLATE utf8mb4_unicode_ci 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, '2014_10_12_000000_create_users_table', 1),
  (2, '2014_10_12_100000_create_password_resets_table', 1),
  (3, '2019_08_19_000000_create_failed_jobs_table', 1);
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `notifications`
  --
  
  CREATE TABLE `notifications` (
    `id_notification` int(11) NOT NULL,
    `id_student` int(11) NOT NULL,
    `work` tinyint(1) NOT NULL,
    `exam` tinyint(1) NOT NULL,
    `continuous_assessment` tinyint(1) NOT NULL,
    `final_note` tinyint(1) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `password_resets`
  --
  
  CREATE TABLE `password_resets` (
    `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `percentage`
  --
  
  CREATE TABLE `percentage` (
    `id_percentage` int(11) NOT NULL,
    `id_course` int(11) NOT NULL,
    `id_class` int(11) NOT NULL,
    `continuous_assessment` float NOT NULL,
    `exams` float NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `schedule`
  --
  
  CREATE TABLE `schedule` (
    `id_schedule` int(11) NOT NULL,
    `id_class` varchar(255) NOT NULL,
    `time_start` datetime NOT NULL,
    `time_end` datetime NOT NULL,
    `day` date NOT NULL,
    `course` varchar(255) NOT NULL,
    `colour` varchar(255) NOT NULL,
    `teacher` int(10) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  --
  -- Volcado de datos para la tabla `schedule`
  --
  
  INSERT INTO `schedule` (`id_schedule`, `id_class`, `time_start`, `time_end`, `day`, `course`, `colour`, `teacher`) VALUES
  (44, 'PHP', '2020-11-24 10:00:00', '2020-11-24 11:00:00', '2020-11-24', 'DAW', '#42f5f2', 1),
  (46, 'PHP', '2020-11-26 10:00:00', '2020-11-26 11:00:00', '2020-11-26', 'DAW', '#42f5f2', 1),
  (48, 'JAVA', '2020-11-16 09:00:00', '2020-11-16 10:30:00', '2020-11-16', 'DAW', '#f00a47', 1),
  (49, 'JAVA', '2020-11-18 09:00:00', '2020-11-18 10:30:00', '2020-11-18', 'DAW', '#f00a47', 1),
  (50, 'ZOCALOS', '2020-11-15 09:00:00', '2020-11-15 10:30:00', '2020-11-15', 'DAM', '#36995c', 1),
  (51, 'ZOCALOS', '2020-11-17 09:00:00', '2020-11-17 10:30:00', '2020-11-17', 'DAM', '#36995c', 1),
  (52, 'BBDD', '2020-11-23 09:00:00', '2020-11-23 10:30:00', '2020-11-23', 'DAM', '#0a4ff0', 1),
  (53, 'BBDD', '2020-11-25 09:00:00', '2020-11-25 10:30:00', '2020-11-25', 'DAM', '#0a4ff0', 1);
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `students`
  --
  
  CREATE TABLE `students` (
    `id` int(11) NOT NULL,
    `username` varchar(255) NOT NULL,
    `pass` varchar(255) NOT NULL,
    `email` varchar(255) NOT NULL,
    `name` varchar(255) NOT NULL,
    `surname` varchar(255) NOT NULL,
    `telephone` varchar(50) NOT NULL,
    `nif` varchar(50) NOT NULL,
    `date_registered` datetime NOT NULL DEFAULT '0000-00-00 00:00:00'
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `teachers`
  --
  
  CREATE TABLE `teachers` (
    `id_teacher` int(11) NOT NULL,
    `name` varchar(255) NOT NULL,
    `surname` varchar(255) NOT NULL,
    `telephone` varchar(50) NOT NULL,
    `nif` varchar(50) NOT NULL,
    `email` varchar(255) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  --
  -- Volcado de datos para la tabla `teachers`
  --
  
  INSERT INTO `teachers` (`id_teacher`, `name`, `surname`, `telephone`, `nif`, `email`) VALUES
  (1, 'Gerard', 'Marquez', '626626650', '35472525T', 'gerard@gerard.com'),
  (2, 'Hector', 'Esquerdo', '623623623', '35735757G', 'hector@hector.com'),
  (3, 'Toni', 'Estirado', '699699699', '98778952C', 'toni@toni.com');
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `users`
  --
  
  CREATE TABLE `users` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `email_verified_at` timestamp NULL DEFAULT NULL,
    `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `users_admin`
  --
  
  CREATE TABLE `users_admin` (
    `id_user_admin` int(11) NOT NULL,
    `username` varchar(255) NOT NULL,
    `name` varchar(255) NOT NULL,
    `email` varchar(255) NOT NULL,
    `password` varchar(255) NOT NULL,
    `course` varchar(255) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  --
  -- Volcado de datos para la tabla `users_admin`
  --
  
  INSERT INTO `users_admin` (`id_user_admin`, `username`, `name`, `email`, `password`, `course`) VALUES
  (0, 'admin', 'Desarrollador WEB', 'admin@admin.com', 'd033e22ae348aeb5660fc2140aec35850c4da997', 'ALL'),
  (21, 'paquito', 'Paco Perez', 'pacoperez@gmail.com', '7110eda4d09e062aa5e4a390b0a572ac0d2c0220', 'DAM'),
  (23, 'sergio', 'Sergio Marquez', 'sergisergi@gmail.com', '7110eda4d09e062aa5e4a390b0a572ac0d2c0220', 'DAW'),
  (24, 'prueba', 'prueba', 'prueba@prueba.com', '7110eda4d09e062aa5e4a390b0a572ac0d2c0220', 'DAM');
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `works`
  --
  
  CREATE TABLE `works` (
    `id_work` int(11) NOT NULL,
    `id_class` int(11) NOT NULL,
    `id_student` int(11) NOT NULL,
    `name` varchar(255) NOT NULL,
    `mark` float NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  --
  -- Índices para tablas volcadas
  --
  
  --
  -- Indices de la tabla `class`
  --
  ALTER TABLE `class`
    ADD PRIMARY KEY (`id_class`),
    ADD UNIQUE KEY `id_teacher` (`id_teacher`,`id_course`,`id_schedule`);
  
  --
  -- Indices de la tabla `courses`
  --
  ALTER TABLE `courses`
    ADD PRIMARY KEY (`id_course`),
    ADD UNIQUE KEY `name` (`name`,`date_start`,`date_end`);
  
  --
  -- Indices de la tabla `enrollment`
  --
  ALTER TABLE `enrollment`
    ADD PRIMARY KEY (`id_enrollment`),
    ADD UNIQUE KEY `id_student` (`id_student`,`id_course`);
  
  --
  -- Indices de la tabla `exams`
  --
  ALTER TABLE `exams`
    ADD PRIMARY KEY (`id_exam`);
  
  --
  -- Indices de la tabla `failed_jobs`
  --
  ALTER TABLE `failed_jobs`
    ADD PRIMARY KEY (`id`),
    ADD UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`);
  
  --
  -- Indices de la tabla `migrations`
  --
  ALTER TABLE `migrations`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indices de la tabla `notifications`
  --
  ALTER TABLE `notifications`
    ADD PRIMARY KEY (`id_notification`),
    ADD UNIQUE KEY `id_student` (`id_student`);
  
  --
  -- Indices de la tabla `password_resets`
  --
  ALTER TABLE `password_resets`
    ADD KEY `password_resets_email_index` (`email`);
  
  --
  -- Indices de la tabla `percentage`
  --
  ALTER TABLE `percentage`
    ADD PRIMARY KEY (`id_percentage`),
    ADD UNIQUE KEY `id_course` (`id_course`,`id_class`);
  
  --
  -- Indices de la tabla `schedule`
  --
  ALTER TABLE `schedule`
    ADD PRIMARY KEY (`id_schedule`);
  
  --
  -- Indices de la tabla `students`
  --
  ALTER TABLE `students`
    ADD PRIMARY KEY (`id`),
    ADD KEY `username` (`username`,`email`);
  
  --
  -- Indices de la tabla `teachers`
  --
  ALTER TABLE `teachers`
    ADD PRIMARY KEY (`id_teacher`);
  
  --
  -- Indices de la tabla `users`
  --
  ALTER TABLE `users`
    ADD PRIMARY KEY (`id`),
    ADD UNIQUE KEY `users_email_unique` (`email`);
  
  --
  -- Indices de la tabla `users_admin`
  --
  ALTER TABLE `users_admin`
    ADD PRIMARY KEY (`id_user_admin`);
  
  --
  -- Indices de la tabla `works`
  --
  ALTER TABLE `works`
    ADD PRIMARY KEY (`id_work`);
  
  --
  -- AUTO_INCREMENT de las tablas volcadas
  --
  
  --
  -- AUTO_INCREMENT de la tabla `class`
  --
  ALTER TABLE `class`
    MODIFY `id_class` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
  
  --
  -- AUTO_INCREMENT de la tabla `courses`
  --
  ALTER TABLE `courses`
    MODIFY `id_course` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
  
  --
  -- AUTO_INCREMENT de la tabla `enrollment`
  --
  ALTER TABLE `enrollment`
    MODIFY `id_enrollment` int(11) NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT de la tabla `exams`
  --
  ALTER TABLE `exams`
    MODIFY `id_exam` int(11) NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT de la tabla `failed_jobs`
  --
  ALTER TABLE `failed_jobs`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT de la tabla `migrations`
  --
  ALTER TABLE `migrations`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
  
  --
  -- AUTO_INCREMENT de la tabla `notifications`
  --
  ALTER TABLE `notifications`
    MODIFY `id_notification` int(11) NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT de la tabla `percentage`
  --
  ALTER TABLE `percentage`
    MODIFY `id_percentage` int(11) NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT de la tabla `schedule`
  --
  ALTER TABLE `schedule`
    MODIFY `id_schedule` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=54;
  
  --
  -- AUTO_INCREMENT de la tabla `students`
  --
  ALTER TABLE `students`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT de la tabla `teachers`
  --
  ALTER TABLE `teachers`
    MODIFY `id_teacher` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
  
  --
  -- AUTO_INCREMENT de la tabla `users`
  --
  ALTER TABLE `users`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT de la tabla `users_admin`
  --
  ALTER TABLE `users_admin`
    MODIFY `id_user_admin` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25;
  
  --
  -- AUTO_INCREMENT de la tabla `works`
  --
  ALTER TABLE `works`
    MODIFY `id_work` int(11) NOT NULL AUTO_INCREMENT;
  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 */;
  