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

START TRANSACTION;



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

--
-- Table structure for table `image_managers`
--

CREATE TABLE `image_managers` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `file_path` varchar(255) NOT NULL,
  `thumb_image` varchar(255) DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `title` varchar(255) NOT NULL,
  `uploaded_by` int(11) NOT NULL,
  `description` longtext NOT NULL,
  `purpose` varchar(255) DEFAULT NULL,
  `tags` longtext DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `image_managers`
--

INSERT INTO `image_managers` (`id`, `file_path`, `thumb_image`, `name`, `title`, `uploaded_by`, `description`, `purpose`, `tags`, `created_at`, `updated_at`) VALUES
(34, 'uploads/empty_box (1)_29HjT.png', 'userThumbnails/1742197762_APPLE__10_.png', 'EEE', 'EEE', 4, 'EEE', NULL, NULL, '2025-03-17 01:37:55', '2025-03-17 02:19:22'),
(35, 'uploads/image4_nGk30.jpg', 'userThumbnails/1742197775_image4_nGk30.jpg', 'ff', 'ff', 4, 'fff', NULL, NULL, '2025-03-17 02:12:30', '2025-03-17 02:19:35'),
(36, 'uploads/Data_management.zip', 'userThumbnails/zFqNdDEZ0IHmGHEdfBE9nJcMAPn93WAyTQG08Tke.png', 'sssss', 'sssss', 4, 'sssss', NULL, NULL, '2025-03-17 02:26:55', '2025-03-17 02:26:55');

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

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

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

--
-- 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, '2025_02_14_051537_image_managers', 1),
(4, '2025_02_14_073538_user_types', 1),
(5, '2025_02_19_062902_tags_management', 1),
(6, '2025_02_27_082944_create_user_download_log_table', 1),
(7, '2025_02_27_083759_create_user_searched_log_table', 1),
(8, '2025_03_03_101846_add_last_login_to_users_table', 1),
(9, '2025_03_05_052801_create_password_request_table', 1),
(10, '2025_03_11_071810_user_view_counts', 2);

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

--
-- Table structure for table `password_request`
--

CREATE TABLE `password_request` (
  `id` int(11) NOT NULL,
  `email` varchar(255) NOT NULL,
  `requested_date` timestamp NULL DEFAULT NULL,
  `status` tinyint(100) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `password_request`
--

INSERT INTO `password_request` (`id`, `email`, `requested_date`, `status`) VALUES
(1, 'user@gmail.com', '2025-03-04 06:03:34', 1),
(2, 'user@gmail.com', '2025-03-04 06:57:57', 0),
(3, 'user@gmail.com', '2025-03-04 07:56:44', 0),
(4, 'user@gmail.com', '2025-03-04 07:58:41', 0);

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

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

CREATE TABLE `sessions` (
  `id` varchar(255) NOT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `ip_address` varchar(45) DEFAULT NULL,
  `user_agent` text DEFAULT NULL,
  `payload` longtext NOT NULL,
  `last_activity` int(11) NOT NULL
) 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
('PdR5MCe1cksFmLpwXTukWY0Y9jgavncQQduRz2HU', 4, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36', 'YTo3OntzOjY6Il90b2tlbiI7czo0MDoiYVk0Y0RzdVJpU3VqQjhRRFE2RkVvRWh4RDdhd3RHY2dubE4wRkZhVSI7czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6MzY6Imh0dHA6Ly8xMjcuMC4wLjE6ODAwMC91c2VyL2Rhc2hib2FyZCI7fXM6NjoiX2ZsYXNoIjthOjI6e3M6Mzoib2xkIjthOjA6e31zOjM6Im5ldyI7YTowOnt9fXM6NTA6ImxvZ2luX3dlYl81OWJhMzZhZGRjMmIyZjk0MDE1ODBmMDE0YzdmNThlYTRlMzA5ODlkIjtpOjQ7czo3OiJ1c2VyX2lkIjtpOjQ7czo5OiJ1c2VyX3R5cGUiO2k6MjtzOjExOiJ1c2VyX3N0YXR1cyI7czoxOiIxIjt9', 1742274386),
('xL7YpHPYzYoEGdJ8RhPYjKnI7N7mfMV3QjDgmGN6', NULL, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36', 'YTozOntzOjY6Il90b2tlbiI7czo0MDoiRWsyVUd4bnJjQnJJaldqUXdtQm03ZTVGWHY5WGxsVmZhM0tRQWhmSCI7czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6Mjc6Imh0dHA6Ly8xMjcuMC4wLjE6ODAwMC9hZG1pbiI7fXM6NjoiX2ZsYXNoIjthOjI6e3M6Mzoib2xkIjthOjA6e31zOjM6Im5ldyI7YTowOnt9fX0=', 1742218379);

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

--
-- Table structure for table `tags_management`
--

CREATE TABLE `tags_management` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `tag_name` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `user_download_log`
--

CREATE TABLE `user_download_log` (
  `udl_id` bigint(20) UNSIGNED NOT NULL,
  `udl_user_id` bigint(20) UNSIGNED NOT NULL,
  `udl_file_id` bigint(20) UNSIGNED NOT NULL,
  `udl_download_date` varchar(100) NOT NULL,
  `udl_created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `user_download_log`
--

INSERT INTO `user_download_log` (`udl_id`, `udl_user_id`, `udl_file_id`, `udl_download_date`, `udl_created_at`, `created_at`, `updated_at`) VALUES
(17, 4, 34, 'rrr', '2025-03-17 07:55:48', NULL, NULL),
(18, 4, 36, '2025-03-17 08:09:43', '2025-03-17 02:39:43', '2025-03-17 02:39:43', '2025-03-17 02:39:43'),
(21, 4, 36, '2025-03-17 08:34:24', '2025-03-17 03:04:24', '2025-03-17 03:04:24', '2025-03-17 03:04:24'),
(22, 4, 36, '2025-03-17 08:36:06', '2025-03-17 03:06:06', '2025-03-17 03:06:06', '2025-03-17 03:06:06'),
(23, 4, 36, '2025-03-17 08:47:03', '2025-03-17 03:17:03', '2025-03-17 03:17:03', '2025-03-17 03:17:03'),
(24, 4, 36, '2025-03-17 08:48:02', '2025-03-17 03:18:02', '2025-03-17 03:18:02', '2025-03-17 03:18:02'),
(25, 4, 36, '2025-03-17 11:58:31', '2025-03-17 06:28:31', '2025-03-17 06:28:31', '2025-03-17 06:28:31');

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

--
-- Table structure for table `user_searched_log`
--

CREATE TABLE `user_searched_log` (
  `usl_id` bigint(20) UNSIGNED NOT NULL,
  `usl_user_id` bigint(20) UNSIGNED NOT NULL,
  `usl_file_id` bigint(20) UNSIGNED NOT NULL,
  `usl_searched_date` varchar(100) NOT NULL,
  `usl_created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `user_types`
--

CREATE TABLE `user_types` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `user_types`
--

INSERT INTO `user_types` (`id`, `name`, `status`, `created_at`, `updated_at`) VALUES
(1, 'Super Admin', 1, '2025-03-07 06:42:24', '2025-03-07 06:42:24'),
(2, 'Sub Admin', 1, '2025-03-07 06:42:24', '2025-03-07 06:42:24'),
(3, ' User', 1, '2025-03-07 06:42:24', '2025-03-07 06:42:24');

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

--
-- Table structure for table `user_view_counts`
--

CREATE TABLE `user_view_counts` (
  `uvc_id` bigint(20) UNSIGNED NOT NULL,
  `uvc_user_id` bigint(20) UNSIGNED NOT NULL,
  `uvc_file_id` bigint(20) UNSIGNED NOT NULL,
  `view_count` int(11) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `user_view_counts`
--

INSERT INTO `user_view_counts` (`uvc_id`, `uvc_user_id`, `uvc_file_id`, `view_count`, `created_at`, `updated_at`) VALUES
(1, 5, 11, 15, '2025-03-11 02:24:38', '2025-03-11 02:29:38'),
(2, 5, 9, 1, '2025-03-11 02:26:40', '2025-03-11 02:26:40'),
(3, 5, 8, 3, '2025-03-11 02:33:03', '2025-03-11 02:33:14'),
(4, 5, 24, 7, '2025-03-11 08:19:46', '2025-03-12 04:45:43'),
(5, 5, 27, 1, '2025-03-12 04:46:38', '2025-03-12 04:46:38'),
(6, 4, 24, 3, '2025-03-17 00:12:23', '2025-03-17 00:12:33'),
(7, 4, 35, 2, '2025-03-17 02:24:23', '2025-03-17 02:24:31'),
(8, 4, 34, 4, '2025-03-17 02:26:11', '2025-03-17 02:39:30'),
(9, 4, 36, 39, '2025-03-17 02:27:04', '2025-03-17 06:28:31');

--
-- Indexes for table `image_managers`
--
ALTER TABLE `image_managers`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `password_request`
--
ALTER TABLE `password_request`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `sessions`
--
ALTER TABLE `sessions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `sessions_user_id_index` (`user_id`),
  ADD KEY `sessions_last_activity_index` (`last_activity`);

--
-- Indexes for table `tags_management`
--
ALTER TABLE `tags_management`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `tags_management_tag_name_unique` (`tag_name`);

--
-- Indexes for table `user_download_log`
--
ALTER TABLE `user_download_log`
  ADD PRIMARY KEY (`udl_id`),
  ADD KEY `user_download_log_udl_user_id_index` (`udl_user_id`),
  ADD KEY `user_download_log_udl_file_id_index` (`udl_file_id`);

--
-- Indexes for table `user_searched_log`
--
ALTER TABLE `user_searched_log`
  ADD PRIMARY KEY (`usl_id`),
  ADD KEY `user_searched_log_usl_user_id_index` (`usl_user_id`),
  ADD KEY `user_searched_log_usl_file_id_index` (`usl_file_id`);

--
-- Indexes for table `user_types`
--
ALTER TABLE `user_types`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `user_types_name_unique` (`name`);

--
-- Indexes for table `user_view_counts`
--
ALTER TABLE `user_view_counts`
  ADD PRIMARY KEY (`uvc_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `image_managers`
--
ALTER TABLE `image_managers`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=37;

--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;

--
-- AUTO_INCREMENT for table `password_request`
--
ALTER TABLE `password_request`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `tags_management`
--
ALTER TABLE `tags_management`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `user_download_log`
--
ALTER TABLE `user_download_log`
  MODIFY `udl_id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26;

--
-- AUTO_INCREMENT for table `user_searched_log`
--
ALTER TABLE `user_searched_log`
  MODIFY `usl_id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=165;

--
-- AUTO_INCREMENT for table `user_types`
--
ALTER TABLE `user_types`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `user_view_counts`
--
ALTER TABLE `user_view_counts`
  MODIFY `uvc_id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `user_download_log`
--
ALTER TABLE `user_download_log`
  ADD CONSTRAINT `user_download_log_udl_file_id_foreign` FOREIGN KEY (`udl_file_id`) REFERENCES `image_managers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `user_download_log_udl_user_id_foreign` FOREIGN KEY (`udl_user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `user_searched_log`
--
ALTER TABLE `user_searched_log`
  ADD CONSTRAINT `user_searched_log_usl_file_id_foreign` FOREIGN KEY (`usl_file_id`) REFERENCES `image_managers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `user_searched_log_usl_user_id_foreign` FOREIGN KEY (`usl_user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
COMMIT;

