--
-- Host: localhost    Database: old_lms
-- ------------------------------------------------------


--
-- Table structure for table `answers`
--

CREATE TABLE `answers` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `question_id` bigint unsigned DEFAULT NULL,
  `answer` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `is_correct` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `answers_question_id_foreign` (`question_id`),
  CONSTRAINT `answers_question_id_foreign` FOREIGN KEY (`question_id`) REFERENCES `questions` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2641 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `answers`
--


--
-- Table structure for table `assets`
--

CREATE TABLE `assets` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `assetable_id` bigint DEFAULT NULL,
  `assetable_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `extension` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `thumb` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `size` bigint unsigned DEFAULT NULL,
  `type` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `assets`
--

INSERT INTO `assets` VALUES (1,NULL,8,'App\\Models\\User','assets/avatars/axiom-favicon1678274219.png','png',NULL,NULL,'AVATAR','2023-03-08 06:16:59','2023-03-08 06:16:59',NULL),(2,NULL,5,'App\\Models\\Category','assets/images/15704462700581678392255.jpeg','jpeg','assets/images/thumbnails/15704462700581678392255.jpeg',12469,'IMAGE','2023-03-09 15:04:15','2023-03-09 15:04:15',NULL),(3,NULL,4,'App\\Models\\Course','assets/images/skedmy1678691680.jpg','jpg','assets/images/thumbnails/skedmy1678691680.jpg',55098,'IMAGE','2023-03-13 02:14:40','2023-03-13 02:14:40',NULL),(4,NULL,2,'App\\Models\\Course','assets/images/skedmy1678700929.jpg','jpg','assets/images/thumbnails/skedmy1678700929.jpg',55098,'IMAGE','2023-03-13 04:48:49','2023-03-13 04:48:49',NULL),(5,NULL,6,'App\\Models\\Category','assets/images/insurance1681320752.png','png','assets/images/thumbnails/insurance1681320752.png',462356,'IMAGE','2023-04-12 12:32:32','2023-04-12 12:32:32',NULL),(6,NULL,7,'App\\Models\\Category','assets/images/certification1681320799.png','png','assets/images/thumbnails/certification1681320799.png',575406,'IMAGE','2023-04-12 12:33:19','2023-04-12 12:33:19',NULL),(7,NULL,1,'App\\Models\\Course','assets/images/property-and-casuality1681321264.png','png','assets/images/thumbnails/property-and-casuality1681321264.png',575406,'IMAGE','2023-04-12 12:41:04','2023-04-12 12:41:04',NULL),(8,NULL,8,'App\\Models\\Category','assets/images/image-removebg-preview1727688608.png','png','assets/images/thumbnails/image-removebg-preview1727688608.png',120770,'IMAGE','2024-09-30 04:30:08','2024-09-30 04:30:08',NULL),(9,NULL,3,'App\\Models\\Course','assets/images/l11728398661.png','png','assets/images/thumbnails/l11728398661.png',7293,'IMAGE','2024-10-08 09:44:21','2024-10-08 09:44:21',NULL),(10,NULL,12,'App\\Models\\Course','assets/images/l11728399161.png','png','assets/images/thumbnails/l11728399161.png',7293,'IMAGE','2024-10-08 09:52:41','2024-10-08 09:52:41',NULL);

--
-- Table structure for table `categories`
--

CREATE TABLE `categories` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `url_title` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `details` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `parent_id` bigint unsigned DEFAULT NULL,
  `status` enum('ACTIVE','INACTIVE') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'ACTIVE',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `categories_parent_id_foreign` (`parent_id`),
  CONSTRAINT `categories_parent_id_foreign` FOREIGN KEY (`parent_id`) REFERENCES `categories` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `categories`
--


--
-- Table structure for table `contents`
--

CREATE TABLE `contents` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(200) DEFAULT NULL,
  `url_title` varchar(255) DEFAULT NULL,
  `contents` longtext,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `contents`
--

INSERT INTO `contents` VALUES (1,'Privacy Policy','privacy-policy',NULL,'2023-04-14 18:34:36','2023-04-14 18:34:36'),(2,'Terms & Conditions','terms-conditions',NULL,'2023-04-14 18:34:36','2023-04-14 18:34:36');

--
-- Table structure for table `course_categories`
--

CREATE TABLE `course_categories` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `course_id` bigint unsigned DEFAULT NULL,
  `category_id` bigint unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `course_categories_course_id_foreign` (`course_id`),
  KEY `course_categories_category_id_foreign` (`category_id`),
  CONSTRAINT `course_categories_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE,
  CONSTRAINT `course_categories_course_id_foreign` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `course_categories`
--


--
-- Table structure for table `courses`
--

CREATE TABLE `courses` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `url_title` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `type` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `details` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `author` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `price` decimal(12,2) DEFAULT '0.00',
  `settings` json DEFAULT NULL,
  `status` enum('ACTIVE','INACTIVE','ARCHIVED') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'ACTIVE',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `courses`
--


--
-- Table structure for table `discount_courses`
--

CREATE TABLE `discount_courses` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `course_id` bigint unsigned DEFAULT NULL,
  `discount_id` bigint unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `discount_courses_course_id_foreign` (`course_id`),
  KEY `discount_courses_discount_id_foreign` (`discount_id`),
  CONSTRAINT `discount_courses_course_id_foreign` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE,
  CONSTRAINT `discount_courses_discount_id_foreign` FOREIGN KEY (`discount_id`) REFERENCES `discounts` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=268 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `discount_courses`
--


--
-- Table structure for table `discount_users`
--

CREATE TABLE `discount_users` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `discount_id` bigint unsigned DEFAULT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `discount_users_discount_id_foreign` (`discount_id`),
  KEY `discount_users_user_id_foreign` (`user_id`),
  CONSTRAINT `discount_users_discount_id_foreign` FOREIGN KEY (`discount_id`) REFERENCES `discounts` (`id`) ON DELETE CASCADE,
  CONSTRAINT `discount_users_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `discount_users`
--


--
-- Table structure for table `discounts`
--

CREATE TABLE `discounts` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `type` enum('COUPON','VOUCHER') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'COUPON',
  `status` enum('ACTIVE','INACTIVE') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'ACTIVE',
  `amount_type` enum('PERCENTAGE','FIXED') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'FIXED',
  `amount` decimal(12,2) DEFAULT '0.00',
  `settings` json DEFAULT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `used_by` bigint unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `partner_id` (`user_id`),
  CONSTRAINT `discounts_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `discounts`
--


--
-- Table structure for table `enrollments`
--

CREATE TABLE `enrollments` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned DEFAULT NULL,
  `course_id` bigint unsigned DEFAULT NULL,
  `status` enum('ACTIVE','INACTIVE') DEFAULT 'ACTIVE',
  `partner_id` bigint unsigned DEFAULT NULL,
  `count` int unsigned DEFAULT '0',
  `expires_at` datetime DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `deleted_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `course_id` (`course_id`),
  KEY `partner_id` (`partner_id`),
  CONSTRAINT `enrollments_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `enrollments_ibfk_2` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE,
  CONSTRAINT `enrollments_ibfk_3` FOREIGN KEY (`partner_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `enrollments`
--


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

CREATE TABLE `failed_jobs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `connection` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `queue` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `exception` longtext CHARACTER SET utf8mb4 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;

--
-- Dumping data for table `failed_jobs`
--


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

CREATE TABLE `migrations` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `migrations` VALUES (1,'2014_10_11_000000_create_assets_table',1),(2,'2014_10_12_000000_create_users_table',1),(3,'2014_10_12_100000_create_password_reset_tokens_table',1),(4,'2019_08_19_000000_create_failed_jobs_table',1),(5,'2019_12_14_000001_create_personal_access_tokens_table',1),(6,'2023_03_04_051650_create_categories_table',2),(7,'2023_03_04_052102_create_permission_tables',2),(8,'2023_03_04_052243_create_courses_table',3),(9,'2023_03_04_052344_create_course_categories_table',3),(10,'2023_03_04_054657_create_sections_table',3),(11,'2023_03_04_055153_create_topics_table',3),(12,'2023_03_05_084345_update_table_assets',4),(13,'2023_03_05_085715_update_table_users_add_status',5),(14,'2023_03_08_075747_update_users_table_add_column_phone',6),(16,'2023_03_31_190717_create_discounts_table',7),(17,'2023_03_31_192240_create_plans_table',7),(18,'2023_04_08_173122_create_plan_courses_table',7),(19,'2023_04_09_195326_create_discount_courses_table',8),(20,'2023_04_09_195358_create_discount_users_table',8),(21,'2023_04_11_185212_create_transactions_table',9),(23,'2023_04_12_195450_create_questions_table',10),(24,'2023_04_12_195500_create_answers_table',10),(25,'2024_10_01_062625_create_user_answers_table',11),(26,'2024_10_08_060621_add_course_id_to_transactions_table',12),(27,'2024_10_08_110032_add_section_id_to_user_progress_table',12),(28,'2024_10_08_151913_update_answer_id_nullable_in_user_answers_table',13);

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

CREATE TABLE `model_has_permissions` (
  `permission_id` bigint unsigned NOT NULL,
  `model_type` varchar(255) CHARACTER SET utf8mb4 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`),
  CONSTRAINT `model_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `model_has_permissions`
--


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

CREATE TABLE `model_has_roles` (
  `role_id` bigint unsigned NOT NULL,
  `model_type` varchar(255) CHARACTER SET utf8mb4 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`),
  CONSTRAINT `model_has_roles_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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


--
-- Table structure for table `password_reset_tokens`
--

CREATE TABLE `password_reset_tokens` (
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `password_reset_tokens`
--


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

CREATE TABLE `permissions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `guard_name` varchar(255) CHARACTER SET utf8mb4 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=29 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `permissions` VALUES (1,'create role','sanctum','2023-03-05 03:22:54','2023-03-05 03:22:54'),(2,'read role','sanctum','2023-03-05 03:22:54','2023-03-05 03:22:54'),(3,'update role','sanctum','2023-03-05 03:22:54','2023-03-05 03:22:54'),(4,'delete role','sanctum','2023-03-05 03:22:54','2023-03-05 03:22:54'),(5,'create user','sanctum','2023-03-05 03:22:54','2023-03-05 03:22:54'),(6,'update user','sanctum','2023-03-05 03:22:54','2023-03-05 03:22:54'),(7,'read user','sanctum','2023-03-05 03:22:54','2023-03-05 03:22:54'),(8,'delete user','sanctum','2023-03-05 03:22:54','2023-03-05 03:22:54'),(9,'create student','sanctum','2023-03-05 03:22:54','2023-03-05 03:22:54'),(10,'update student','sanctum','2023-03-05 03:22:54','2023-03-05 03:22:54'),(11,'read student','sanctum','2023-03-05 03:22:54','2023-03-05 03:22:54'),(12,'delete student','sanctum','2023-03-05 03:22:54','2023-03-05 03:22:54'),(13,'create partner','sanctum','2023-03-05 03:22:54','2023-03-05 03:22:54'),(14,'update partner','sanctum','2023-03-05 03:22:54','2023-03-05 03:22:54'),(15,'read partner','sanctum','2023-03-05 03:22:54','2023-03-05 03:22:54'),(16,'delete partner','sanctum','2023-03-05 03:22:54','2023-03-05 03:22:54'),(17,'create fee','sanctum','2024-09-30 04:29:12','2024-09-30 04:29:12'),(18,'read fee','sanctum','2024-09-30 04:29:12','2024-09-30 04:29:12'),(19,'update fee','sanctum','2024-09-30 04:29:12','2024-09-30 04:29:12'),(20,'delete fee','sanctum','2024-09-30 04:29:12','2024-09-30 04:29:12'),(21,'create payroll','sanctum','2024-09-30 04:29:12','2024-09-30 04:29:12'),(22,'update payroll','sanctum','2024-09-30 04:29:12','2024-09-30 04:29:12'),(23,'read payroll','sanctum','2024-09-30 04:29:12','2024-09-30 04:29:12'),(24,'delete payroll','sanctum','2024-09-30 04:29:12','2024-09-30 04:29:12'),(25,'create expense','sanctum','2024-09-30 04:29:12','2024-09-30 04:29:12'),(26,'update expense','sanctum','2024-09-30 04:29:12','2024-09-30 04:29:12'),(27,'read expense','sanctum','2024-09-30 04:29:12','2024-09-30 04:29:12'),(28,'delete expense','sanctum','2024-09-30 04:29:12','2024-09-30 04:29:12');

--
-- Table structure for table `personal_access_tokens`
--

CREATE TABLE `personal_access_tokens` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `tokenable_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `tokenable_id` bigint unsigned NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `token` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `abilities` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `last_used_at` timestamp NULL DEFAULT NULL,
  `expires_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 AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `personal_access_tokens`
--

INSERT INTO `personal_access_tokens` VALUES (1,'App\\Models\\User',1,'ExamTx-Admin-Token','1328ff9189f28236968df0f75647b6c7f0c1d654736b0ab873e61a7732882ecc','[\"*\"]','2024-09-30 04:30:15',NULL,'2024-09-30 04:28:53','2024-09-30 04:30:15'),(2,'App\\Models\\User',1,'ExamTx-Admin-Token','21e816600d648f5eef78624efdeb6821c12119fbcde8d78f57519a2d15070394','[\"*\"]','2024-09-30 06:01:50',NULL,'2024-09-30 05:19:54','2024-09-30 06:01:50'),(3,'App\\Models\\User',12,'ExamTx-Portal-Token','74cb900033f4f25a3cc01073be7c5e6e956dd0f85e9d578e8014ca3401b756fb','[\"*\"]','2024-10-01 05:27:20',NULL,'2024-10-01 01:07:41','2024-10-01 05:27:20'),(4,'App\\Models\\User',12,'ExamTx-Portal-Token','8b0dce61c92b1b488a45a6650071257aca77c6deb20b1677d4312e8931ef6332','[\"*\"]','2024-10-02 01:00:06',NULL,'2024-10-01 02:47:17','2024-10-02 01:00:06'),(5,'App\\Models\\User',12,'ExamTx-Portal-Token','393e0227f987ac05c15bc3b58145059e2cd382f46d0ad63214b206bf00a16c4a','[\"*\"]','2024-10-02 05:57:33',NULL,'2024-10-02 01:00:38','2024-10-02 05:57:33'),(6,'App\\Models\\User',12,'ExamTx-Portal-Token','899fae41fbe573bab7d2009632ce1d4f934129bc1620253fb815c636232f0c3c','[\"*\"]','2024-10-03 06:52:27',NULL,'2024-10-03 02:09:09','2024-10-03 06:52:27'),(7,'App\\Models\\User',13,'ExamTx-Admin-Token','63729f379ef061245cd4c6a6f65a4ee6953c78c9696df2086cd6ac196f6b1bf2','[\"*\"]','2024-10-03 02:40:16',NULL,'2024-10-03 02:10:13','2024-10-03 02:40:16'),(8,'App\\Models\\User',13,'ExamTx-Admin-Token','882a81760c3ddd08d6e702aea74bb15090996b6f4e6d88264e50a2d2d80858d2','[\"*\"]','2024-10-11 03:57:59',NULL,'2024-10-08 09:09:41','2024-10-11 03:57:59'),(9,'App\\Models\\User',12,'ExamTx-Portal-Token','d149b8e5c2c34f44c703252be09d5e3557b7b67c602d2f29b98366a9b8a28285','[\"*\"]','2024-10-08 15:08:08',NULL,'2024-10-08 09:12:27','2024-10-08 15:08:08'),(10,'App\\Models\\User',12,'ExamTx-Portal-Token','2dcb01c94eae57f0870c6ce4e9263208395b27592da6f0ad771a7a08774f1993','[\"*\"]','2024-10-11 03:54:18',NULL,'2024-10-08 15:08:56','2024-10-11 03:54:18'),(11,'App\\Models\\User',13,'ExamTx-Admin-Token','ce70d2318f7b4d37b3242730c1467335671a7cbf365651f6fe58c35a705fc609','[\"*\"]','2024-10-11 03:59:58',NULL,'2024-10-11 03:58:05','2024-10-11 03:59:58'),(12,'App\\Models\\User',13,'ExamTx-Admin-Token','4ce4ce495cf394fd8b0c8d41ba63f7d46f0ff2b90fe941dd9b9d55df755535ee','[\"*\"]','2024-10-11 04:01:16',NULL,'2024-10-11 04:00:01','2024-10-11 04:01:16'),(13,'App\\Models\\User',13,'ExamTx-Admin-Token','2970d1187e7b677f9279fe1644c07f84c67d0a345d54023450b942a8525e2029','[\"*\"]','2024-10-11 04:01:40',NULL,'2024-10-11 04:01:20','2024-10-11 04:01:40');

--
-- Table structure for table `plan_courses`
--

CREATE TABLE `plan_courses` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `course_id` bigint unsigned DEFAULT NULL,
  `plan_id` bigint unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `plan_courses_course_id_foreign` (`course_id`),
  KEY `plan_courses_plan_id_foreign` (`plan_id`),
  CONSTRAINT `plan_courses_course_id_foreign` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE,
  CONSTRAINT `plan_courses_plan_id_foreign` FOREIGN KEY (`plan_id`) REFERENCES `plans` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `plan_courses`
--


--
-- Table structure for table `plans`
--

CREATE TABLE `plans` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `url_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `price` decimal(12,2) DEFAULT '0.00',
  `users` int DEFAULT '0',
  `status` enum('ACTIVE','INACTIVE') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'ACTIVE',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `plans`
--


--
-- Table structure for table `questions`
--

CREATE TABLE `questions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `questionable_id` bigint unsigned DEFAULT NULL,
  `questionable_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `question` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `explanation` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `level` enum('EASY','MEDIUM','HARD') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'MEDIUM',
  `type` enum('MCQ','BOOL','BLANK') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'MCQ',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=550 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `questions`
--


--
-- Table structure for table `reviews`
--

CREATE TABLE `reviews` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned DEFAULT NULL,
  `course_id` bigint unsigned DEFAULT NULL,
  `rating` int unsigned DEFAULT '0',
  `comments` text,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `reviews`
--


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

CREATE TABLE `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`),
  CONSTRAINT `role_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE,
  CONSTRAINT `role_has_permissions_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `role_has_permissions` 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);

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

CREATE TABLE `roles` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `guard_name` varchar(255) CHARACTER SET utf8mb4 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=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `roles` VALUES (1,'Admin','Admin with full access','sanctum','2023-03-05 03:22:54','2023-03-05 03:22:54');

--
-- Table structure for table `sections`
--

CREATE TABLE `sections` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `url_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `course_id` bigint unsigned DEFAULT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `details` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `settings` json DEFAULT NULL,
  `order` int DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sections_course_id_foreign` (`course_id`),
  CONSTRAINT `sections_course_id_foreign` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sections`
--


--
-- Table structure for table `topics`
--

CREATE TABLE `topics` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `url_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `section_id` bigint unsigned DEFAULT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `details` json DEFAULT NULL,
  `settings` json DEFAULT NULL,
  `type` enum('MEDIA','QUIZ','CERTIFICATE','DOCUMENT','TEXT','CARDS','AUDIO','VIDEO') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'VIDEO',
  `order` int DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `topics_section_id_foreign` (`section_id`),
  CONSTRAINT `topics_section_id_foreign` FOREIGN KEY (`section_id`) REFERENCES `sections` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=235 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `topics`
--


--
-- Table structure for table `transactions`
--

CREATE TABLE `transactions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `type` enum('COURSE','PLAN','OTHER') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'COURSE',
  `charge_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `course_id` bigint unsigned DEFAULT NULL,
  `sub_total` decimal(12,2) DEFAULT '0.00',
  `discount` decimal(12,2) DEFAULT '0.00',
  `total` decimal(12,2) DEFAULT '0.00',
  `transactable_id` bigint unsigned DEFAULT NULL,
  `transactable_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `discount_id` bigint unsigned DEFAULT NULL,
  `status` enum('SUCCESS','PENDING') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'SUCCESS',
  `details` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `transactions_course_id_foreign` (`transactable_id`),
  KEY `transactions_plan_id_foreign` (`transactable_type`),
  KEY `transactions_user_id_foreign` (`user_id`),
  KEY `transactions_discount_id_foreign` (`discount_id`),
  CONSTRAINT `transactions_discount_id_foreign` FOREIGN KEY (`discount_id`) REFERENCES `discounts` (`id`) ON DELETE CASCADE,
  CONSTRAINT `transactions_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `transactions`
--


--
-- Table structure for table `user_answers`
--

CREATE TABLE `user_answers` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned NOT NULL,
  `topic_id` bigint unsigned NOT NULL,
  `question_id` bigint unsigned NOT NULL,
  `answer_id` bigint unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_answers_user_id_foreign` (`user_id`),
  KEY `user_answers_topic_id_foreign` (`topic_id`),
  KEY `user_answers_question_id_foreign` (`question_id`),
  KEY `user_answers_answer_id_foreign` (`answer_id`),
  CONSTRAINT `user_answers_answer_id_foreign` FOREIGN KEY (`answer_id`) REFERENCES `answers` (`id`) ON DELETE CASCADE,
  CONSTRAINT `user_answers_question_id_foreign` FOREIGN KEY (`question_id`) REFERENCES `questions` (`id`) ON DELETE CASCADE,
  CONSTRAINT `user_answers_topic_id_foreign` FOREIGN KEY (`topic_id`) REFERENCES `topics` (`id`) ON DELETE CASCADE,
  CONSTRAINT `user_answers_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=130 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `user_answers`
--


--
-- Table structure for table `user_progress`
--

CREATE TABLE `user_progress` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned DEFAULT NULL,
  `section_id` bigint unsigned DEFAULT NULL,
  `topic_id` bigint unsigned DEFAULT NULL,
  `time` double DEFAULT '0',
  `percentage` int DEFAULT '0',
  `details` json DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `deleted_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `topic_id` (`topic_id`),
  KEY `user_progress_section_id_foreign` (`section_id`),
  CONSTRAINT `user_progress_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `user_progress_ibfk_2` FOREIGN KEY (`topic_id`) REFERENCES `topics` (`id`) ON DELETE CASCADE,
  CONSTRAINT `user_progress_section_id_foreign` FOREIGN KEY (`section_id`) REFERENCES `sections` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `user_progress`
--


--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `first_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `phone` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `hash` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `asset_id` bigint unsigned DEFAULT NULL,
  `type` enum('MANAGER','PARTNER','STUDENT','INSTRUCTOR') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'STUDENT',
  `status` enum('ACTIVE','INACTIVE','SUSPENDED','BLOCKED') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'ACTIVE',
  `ip_signup` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `remember_token` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email_verified_at` timestamp NULL DEFAULT NULL,
  `is_admin` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `users_email_unique` (`email`),
  KEY `users_asset_id_foreign` (`asset_id`),
  CONSTRAINT `users_asset_id_foreign` FOREIGN KEY (`asset_id`) REFERENCES `assets` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `users`
--

INSERT INTO `users` VALUES (13,'Admin','User','admin@gmail.com','1234567890','$2y$10$/T.zBkqSKzlm6h6yHtFqQO.D830WctzpqMfP4JBF/gyS9fWeYv/7u',NULL,NULL,'MANAGER','ACTIVE',NULL,NULL,NULL,0,'2024-09-30 04:29:45','2024-09-30 04:29:45',NULL);


