text: -- phpMyAdmin SQL Dump
  -- version 5.0.2
  -- https://www.phpmyadmin.net/
  --
  -- Host: 127.0.0.1:3306
  -- Generation Time: Jan 14, 2021 at 09:55 PM
  -- Server version: 8.0.21
  -- PHP Version: 7.3.21
  
  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 */;
  
  --
  -- Database: `onlinecourses`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `categories`
  --
  
  DROP TABLE IF EXISTS `categories`;
  CREATE TABLE IF NOT EXISTS `categories` (
    `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
    `name` varchar(255) NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `category_courses`
  --
  
  DROP TABLE IF EXISTS `category_courses`;
  CREATE TABLE IF NOT EXISTS `category_courses` (
    `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL,
    `course_id` bigint UNSIGNED DEFAULT NULL,
    `category_id` bigint UNSIGNED DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `category_courses_course_id_foreign` (`course_id`),
    KEY `category_courses_category_id_foreign` (`category_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `courses`
  --
  
  DROP TABLE IF EXISTS `courses`;
  CREATE TABLE IF NOT EXISTS `courses` (
    `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL,
    `name` varchar(255) NOT NULL,
    `duration` varchar(255) DEFAULT NULL,
    `description` text,
    `content` text,
    `image` text,
    `instructor_id` bigint UNSIGNED DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `courses_instructor_id_foreign` (`instructor_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `course_videos`
  --
  
  DROP TABLE IF EXISTS `course_videos`;
  CREATE TABLE IF NOT EXISTS `course_videos` (
    `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL,
    `video_url` text,
    `course_id` bigint UNSIGNED DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `course_videos_course_id_foreign` (`course_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `failed_jobs`
  --
  
  DROP TABLE IF EXISTS `failed_jobs`;
  CREATE TABLE IF NOT EXISTS `failed_jobs` (
    `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
    `uuid` varchar(255) NOT NULL,
    `connection` text NOT NULL,
    `queue` text NOT NULL,
    `payload` longtext NOT NULL,
    `exception` longtext NOT NULL,
    `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`),
    UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `migrations`
  --
  
  DROP TABLE IF EXISTS `migrations`;
  CREATE TABLE IF NOT EXISTS `migrations` (
    `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
    `migration` varchar(255) NOT NULL,
    `batch` int NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;
  
  --
  -- Dumping data for table `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, '2014_10_12_200000_add_two_factor_columns_to_users_table', 1),
  (4, '2019_08_19_000000_create_failed_jobs_table', 1),
  (5, '2019_12_14_000001_create_personal_access_tokens_table', 1),
  (6, '2021_01_14_183947_create_sessions_table', 1),
  (7, '2021_01_14_184202_create_courses_table', 1),
  (8, '2021_01_14_184303_create_student_courses_table', 1),
  (9, '2021_01_14_184410_create_course_videos_table', 1),
  (10, '2021_01_14_184510_create_categories_table', 1),
  (11, '2021_01_14_184538_create_category_courses_table', 1);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `password_resets`
  --
  
  DROP TABLE IF EXISTS `password_resets`;
  CREATE TABLE IF NOT EXISTS `password_resets` (
    `email` varchar(255) NOT NULL,
    `token` varchar(255) NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    KEY `password_resets_email_index` (`email`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `personal_access_tokens`
  --
  
  DROP TABLE IF EXISTS `personal_access_tokens`;
  CREATE TABLE IF NOT EXISTS `personal_access_tokens` (
    `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
    `tokenable_type` varchar(255) NOT NULL,
    `tokenable_id` bigint UNSIGNED NOT NULL,
    `name` varchar(255) NOT NULL,
    `token` varchar(64) NOT NULL,
    `abilities` text,
    `last_used_at` timestamp NULL DEFAULT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `personal_access_tokens_token_unique` (`token`),
    KEY `personal_access_tokens_tokenable_type_tokenable_id_index` (`tokenable_type`,`tokenable_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `sessions`
  --
  
  DROP TABLE IF EXISTS `sessions`;
  CREATE TABLE IF NOT EXISTS `sessions` (
    `id` varchar(255) NOT NULL,
    `user_id` bigint UNSIGNED DEFAULT NULL,
    `ip_address` varchar(45) DEFAULT NULL,
    `user_agent` text,
    `payload` text 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=utf8;
  
  --
  -- Dumping data for table `sessions`
  --
  
  INSERT INTO `sessions` (`id`, `user_id`, `ip_address`, `user_agent`, `payload`, `last_activity`) VALUES
  ('Ji3Q6HkdPog1RDMDipAOFQ5XUR29FvmObNvNdd7y', 1, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36', 'YTo2OntzOjY6Il90b2tlbiI7czo0MDoiZEJYdjJkR0x6azZpdkc2VE9TdTd6SmNrV09hMmw0TVF3UlNwckF0NCI7czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6Mjg6Imh0dHA6Ly8xMjcuMC4wLjE6NzAwMC9wbGF5ZXIiO31zOjY6Il9mbGFzaCI7YToyOntzOjM6Im9sZCI7YTowOnt9czozOiJuZXciO2E6MDp7fX1zOjUwOiJsb2dpbl93ZWJfNTliYTM2YWRkYzJiMmY5NDAxNTgwZjAxNGM3ZjU4ZWE0ZTMwOTg5ZCI7aToxO3M6MTc6InBhc3N3b3JkX2hhc2hfd2ViIjtzOjYwOiIkMnkkMTAkT2FGTjB6TGpNWTdZT0NXdndaR1A4dVdXUWdkV0tMOTVjcndBZ0l4azZLcWtuVWs5R2JpekciO3M6MjE6InBhc3N3b3JkX2hhc2hfc2FuY3R1bSI7czo2MDoiJDJ5JDEwJE9hRk4wekxqTVk3WU9DV3Z3WkdQOHVXV1FnZFdLTDk1Y3J3QWdJeGs2S3FrblVrOUdiaXpHIjt9', 1610658111);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `student_courses`
  --
  
  DROP TABLE IF EXISTS `student_courses`;
  CREATE TABLE IF NOT EXISTS `student_courses` (
    `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL,
    `student_id` bigint UNSIGNED DEFAULT NULL,
    `course_id` bigint UNSIGNED DEFAULT NULL,
    `enroll_date` timestamp NULL DEFAULT NULL,
    `feedback_date` timestamp NULL DEFAULT NULL,
    `feedback` varchar(255) DEFAULT NULL,
    `comment` text,
    PRIMARY KEY (`id`),
    KEY `student_courses_student_id_foreign` (`student_id`),
    KEY `student_courses_course_id_foreign` (`course_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `users`
  --
  
  DROP TABLE IF EXISTS `users`;
  CREATE TABLE IF NOT EXISTS `users` (
    `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
    `name` varchar(255) NOT NULL,
    `email` varchar(255) NOT NULL,
    `phone` bigint UNSIGNED DEFAULT NULL,
    `email_verified_at` timestamp NULL DEFAULT NULL,
    `password` varchar(255) NOT NULL,
    `two_factor_secret` text,
    `two_factor_recovery_codes` text,
    `remember_token` varchar(100) DEFAULT NULL,
    `current_team_id` bigint UNSIGNED DEFAULT NULL,
    `profile_photo_path` text,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL,
    `role` enum('admin','student','instructor') NOT NULL DEFAULT 'student',
    `university` varchar(255) DEFAULT NULL,
    `dob` timestamp NULL DEFAULT NULL,
    `gender` enum('male','female','other') NOT NULL DEFAULT 'other',
    `specialist` text,
    `description` text,
    `address` text,
    PRIMARY KEY (`id`),
    UNIQUE KEY `users_email_unique` (`email`)
  ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
  
  --
  -- Dumping data for table `users`
  --
  
  INSERT INTO `users` (`id`, `name`, `email`, `phone`, `email_verified_at`, `password`, `two_factor_secret`, `two_factor_recovery_codes`, `remember_token`, `current_team_id`, `profile_photo_path`, `created_at`, `updated_at`, `role`, `university`, `dob`, `gender`, `specialist`, `description`, `address`) VALUES
  (1, 'Sayed Abdallah', 'sayed@gmail.com', NULL, NULL, '$2y$10$OaFN0zLjMY7YOCWvwZGP8uWWQgdWKL95crwAgIxk6KqknUk9GbizG', NULL, NULL, NULL, NULL, NULL, '2021-01-14 17:11:43', '2021-01-14 17:11:43', 'student', NULL, NULL, 'other', NULL, NULL, NULL);
  
  --
  -- Constraints for dumped tables
  --
  
  --
  -- Constraints for table `category_courses`
  --
  ALTER TABLE `category_courses`
    ADD CONSTRAINT `category_courses_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
    ADD CONSTRAINT `category_courses_course_id_foreign` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
  
  --
  -- Constraints for table `courses`
  --
  ALTER TABLE `courses`
    ADD CONSTRAINT `courses_instructor_id_foreign` FOREIGN KEY (`instructor_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
  
  --
  -- Constraints for table `course_videos`
  --
  ALTER TABLE `course_videos`
    ADD CONSTRAINT `course_videos_course_id_foreign` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
  
  --
  -- Constraints for table `student_courses`
  --
  ALTER TABLE `student_courses`
    ADD CONSTRAINT `student_courses_course_id_foreign` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
    ADD CONSTRAINT `student_courses_student_id_foreign` FOREIGN KEY (`student_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
  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 */;
  