-- https://www.phpmyadmin.net/
--
-- Anamakine: localhost:3306
-- Üretim Zamanı: 01 May 2026, 21:29:54
-- Sunucu sürümü: 8.4.3
-- PHP Sürümü: 8.3.28

START TRANSACTION;



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

--
-- Tablo için tablo yapısı `download_logs`
--

CREATE TABLE `download_logs` (
  `id` int NOT NULL,
  `file_id` int NOT NULL,
  `user_telegram_id` bigint NOT NULL,
  `download_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` text COLLATE utf8mb4_unicode_ci
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Tablo döküm verisi `download_logs`
--

INSERT INTO `download_logs` (`id`, `file_id`, `user_telegram_id`, `download_time`, `ip_address`, `user_agent`) VALUES
(1, 1, 0, '2026-01-19 13:09:49', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36'),
(2, 2, 0, '2026-01-19 13:09:55', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36'),
(3, 3, 0, '2026-01-19 13:24:23', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36'),
(4, 8, 0, '2026-01-19 13:25:31', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36'),
(5, 7, 0, '2026-01-19 13:25:35', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36'),
(6, 11, 0, '2026-01-19 13:41:39', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36'),
(7, 12, 0, '2026-01-19 13:41:42', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36'),
(8, 6, 0, '2026-01-19 13:41:44', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36'),
(9, 14, 0, '2026-01-19 13:51:40', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36'),
(10, 14, 0, '2026-01-19 16:33:35', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36'),
(11, 15, 0, '2026-01-21 18:50:46', '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36'),
(12, 18, 0, '2026-04-30 20:16:22', '192.168.1.103', 'Expo/1017756 CFNetwork/3860.400.51 Darwin/25.3.0'),
(13, 18, 0, '2026-04-30 20:44:25', '192.168.1.103', 'Expo/1017756 CFNetwork/3860.400.51 Darwin/25.3.0'),
(14, 21, 0, '2026-04-30 22:09:21', '192.168.1.103', 'Expo/1017756 CFNetwork/3860.400.51 Darwin/25.3.0'),
(15, 21, 0, '2026-04-30 22:29:27', '192.168.1.103', 'AppleCoreMedia/1.0.0.23D8133 (iPhone; U; CPU OS 26_3_1 like Mac OS X; tr_tr)'),
(16, 21, 0, '2026-04-30 22:29:28', '192.168.1.103', 'AppleCoreMedia/1.0.0.23D8133 (iPhone; U; CPU OS 26_3_1 like Mac OS X; tr_tr)'),
(17, 21, 0, '2026-04-30 22:29:35', '192.168.1.103', 'AppleCoreMedia/1.0.0.23D8133 (iPhone; U; CPU OS 26_3_1 like Mac OS X; tr_tr)'),
(18, 21, 0, '2026-04-30 22:29:36', '192.168.1.103', 'AppleCoreMedia/1.0.0.23D8133 (iPhone; U; CPU OS 26_3_1 like Mac OS X; tr_tr)'),
(19, 21, 0, '2026-04-30 22:29:36', '192.168.1.103', 'AppleCoreMedia/1.0.0.23D8133 (iPhone; U; CPU OS 26_3_1 like Mac OS X; tr_tr)'),
(20, 21, 0, '2026-04-30 22:29:37', '192.168.1.103', 'AppleCoreMedia/1.0.0.23D8133 (iPhone; U; CPU OS 26_3_1 like Mac OS X; tr_tr)'),
(21, 21, 0, '2026-04-30 22:29:39', '192.168.1.103', 'AppleCoreMedia/1.0.0.23D8133 (iPhone; U; CPU OS 26_3_1 like Mac OS X; tr_tr)'),
(22, 21, 0, '2026-04-30 22:29:39', '192.168.1.103', 'AppleCoreMedia/1.0.0.23D8133 (iPhone; U; CPU OS 26_3_1 like Mac OS X; tr_tr)'),
(23, 21, 0, '2026-04-30 22:29:40', '192.168.1.103', 'AppleCoreMedia/1.0.0.23D8133 (iPhone; U; CPU OS 26_3_1 like Mac OS X; tr_tr)'),
(24, 21, 0, '2026-04-30 22:34:57', '192.168.1.103', 'AppleCoreMedia/1.0.0.23D8133 (iPhone; U; CPU OS 26_3_1 like Mac OS X; tr_tr)'),
(25, 21, 0, '2026-04-30 22:34:59', '192.168.1.103', 'AppleCoreMedia/1.0.0.23D8133 (iPhone; U; CPU OS 26_3_1 like Mac OS X; tr_tr)'),
(26, 21, 0, '2026-04-30 22:42:29', '192.168.1.103', 'AppleCoreMedia/1.0.0.23D8133 (iPhone; U; CPU OS 26_3_1 like Mac OS X; tr_tr)'),
(27, 21, 0, '2026-04-30 22:42:30', '192.168.1.103', 'AppleCoreMedia/1.0.0.23D8133 (iPhone; U; CPU OS 26_3_1 like Mac OS X; tr_tr)'),
(28, 21, 0, '2026-04-30 22:42:54', '192.168.1.103', 'AppleCoreMedia/1.0.0.23D8133 (iPhone; U; CPU OS 26_3_1 like Mac OS X; tr_tr)'),
(29, 21, 0, '2026-04-30 22:42:55', '192.168.1.103', 'AppleCoreMedia/1.0.0.23D8133 (iPhone; U; CPU OS 26_3_1 like Mac OS X; tr_tr)'),
(30, 21, 0, '2026-04-30 22:46:42', '192.168.1.103', 'AppleCoreMedia/1.0.0.23D8133 (iPhone; U; CPU OS 26_3_1 like Mac OS X; tr_tr)'),
(31, 21, 0, '2026-04-30 22:46:43', '192.168.1.103', 'AppleCoreMedia/1.0.0.23D8133 (iPhone; U; CPU OS 26_3_1 like Mac OS X; tr_tr)'),
(32, 21, 0, '2026-04-30 22:50:42', '192.168.1.103', 'AppleCoreMedia/1.0.0.23D8133 (iPhone; U; CPU OS 26_3_1 like Mac OS X; tr_tr)'),
(33, 21, 0, '2026-04-30 22:50:43', '192.168.1.103', 'AppleCoreMedia/1.0.0.23D8133 (iPhone; U; CPU OS 26_3_1 like Mac OS X; tr_tr)'),
(34, 21, 0, '2026-04-30 22:50:49', '192.168.1.103', 'AppleCoreMedia/1.0.0.23D8133 (iPhone; U; CPU OS 26_3_1 like Mac OS X; tr_tr)'),
(35, 21, 0, '2026-04-30 22:50:51', '192.168.1.103', 'AppleCoreMedia/1.0.0.23D8133 (iPhone; U; CPU OS 26_3_1 like Mac OS X; tr_tr)'),
(36, 21, 0, '2026-04-30 22:51:09', '192.168.1.103', 'AppleCoreMedia/1.0.0.23D8133 (iPhone; U; CPU OS 26_3_1 like Mac OS X; tr_tr)'),
(37, 21, 0, '2026-04-30 22:51:10', '192.168.1.103', 'AppleCoreMedia/1.0.0.23D8133 (iPhone; U; CPU OS 26_3_1 like Mac OS X; tr_tr)'),
(38, 21, 0, '2026-04-30 22:51:16', '192.168.1.103', 'AppleCoreMedia/1.0.0.23D8133 (iPhone; U; CPU OS 26_3_1 like Mac OS X; tr_tr)'),
(39, 21, 0, '2026-04-30 22:51:17', '192.168.1.103', 'AppleCoreMedia/1.0.0.23D8133 (iPhone; U; CPU OS 26_3_1 like Mac OS X; tr_tr)'),
(40, 22, 0, '2026-05-01 19:35:38', '192.168.1.104', 'Expo/1017756 CFNetwork/3860.400.51 Darwin/25.3.0'),
(41, 36, 0, '2026-05-01 21:13:07', '192.168.1.104', 'Expo/1017756 CFNetwork/3860.400.51 Darwin/25.3.0'),
(42, 21, 0, '2026-05-01 21:13:10', '192.168.1.104', 'Expo/1017756 CFNetwork/3860.400.51 Darwin/25.3.0'),
(43, 18, 0, '2026-05-01 21:13:18', '192.168.1.104', 'Expo/1017756 CFNetwork/3860.400.51 Darwin/25.3.0');

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

--
-- Tablo için tablo yapısı `file_tags`
--

CREATE TABLE `file_tags` (
  `file_id` int NOT NULL,
  `tag_id` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

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

--
-- Tablo için tablo yapısı `folders`
--

CREATE TABLE `folders` (
  `id` int NOT NULL,
  `user_id` int NOT NULL,
  `name` varchar(255) NOT NULL,
  `color` varchar(7) DEFAULT '#3e577a',
  `icon` varchar(64) DEFAULT 'folder',
  `parent_id` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Tablo döküm verisi `folders`
--

INSERT INTO `folders` (`id`, `user_id`, `name`, `color`, `icon`, `parent_id`, `created_at`, `deleted_at`) VALUES
(2, 2, 'deneme', '#2563EB', 'photo-library', NULL, '2026-05-01 21:26:50', '2026-05-01 18:27:28');

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

--
-- Tablo için tablo yapısı `system_config`
--

CREATE TABLE `system_config` (
  `config_key` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `config_value` text COLLATE utf8mb4_unicode_ci,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Tablo döküm verisi `system_config`
--

INSERT INTO `system_config` (`config_key`, `config_value`, `updated_at`) VALUES
('telethon_session', '1BJWap1sBuyx5HJpJ_3yZI-OFcB3JXk_Gm1he-8_2A428TzNdfnaZxk_v0-K__GD2Dw_dlHNHTQqSe_VALrwbGL2v_PZmplGsmYTlkBl9ymU1r7qlh6x0-EOPMX8VBJjjZ_1aUc84KUVQoYy91U4vcDxf-QUU3_nBcLLRvTgIXFT1yIW5TtCu5e5IfSDOGWhit1BZpFQv0Pzc-kBcapm6qMe8YR51oNwRcKGftMJqETEGpJt6KC-vMcQqYL9je1mWKHAAz_U2cdYoEDw7cNr1JXAIg3HqDtV218D4T87fW_1LU2mP0Zq_BK6RtujcGlfcrkdMt3_a-Z4hKjJHfbGZlhyY5RErtFY=', '2026-01-19 12:43:01');

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

--
-- Tablo için tablo yapısı `tags`
--

CREATE TABLE `tags` (
  `id` int NOT NULL,
  `user_id` int NOT NULL,
  `name` varchar(255) NOT NULL,
  `color` varchar(7) DEFAULT '#3e577a',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Tablo için indeksler `download_logs`
--
ALTER TABLE `download_logs`
  ADD PRIMARY KEY (`id`);

--
-- Tablo için indeksler `file_tags`
--
ALTER TABLE `file_tags`
  ADD PRIMARY KEY (`file_id`,`tag_id`),
  ADD KEY `tag_id` (`tag_id`);

--
-- Tablo için indeksler `folders`
--
ALTER TABLE `folders`
  ADD PRIMARY KEY (`id`),
  ADD KEY `user_id` (`user_id`),
  ADD KEY `parent_id` (`parent_id`);

--
-- Tablo için indeksler `system_config`
--
ALTER TABLE `system_config`
  ADD PRIMARY KEY (`config_key`);

--
-- Tablo için indeksler `tags`
--
ALTER TABLE `tags`
  ADD PRIMARY KEY (`id`),
  ADD KEY `user_id` (`user_id`);

--
-- Tablo için AUTO_INCREMENT değeri `download_logs`
--
ALTER TABLE `download_logs`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=44;

--
-- Tablo için AUTO_INCREMENT değeri `folders`
--
ALTER TABLE `folders`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- Tablo için AUTO_INCREMENT değeri `tags`
--
ALTER TABLE `tags`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- Tablo kısıtlamaları `file_tags`
--
ALTER TABLE `file_tags`
  ADD CONSTRAINT `file_tags_ibfk_1` FOREIGN KEY (`file_id`) REFERENCES `files` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `file_tags_ibfk_2` FOREIGN KEY (`tag_id`) REFERENCES `tags` (`id`) ON DELETE CASCADE;

--
-- Tablo kısıtlamaları `folders`
--
ALTER TABLE `folders`
  ADD CONSTRAINT `folders_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `folders_ibfk_2` FOREIGN KEY (`parent_id`) REFERENCES `folders` (`id`) ON DELETE CASCADE;

--
-- Tablo kısıtlamaları `tags`
--
ALTER TABLE `tags`
  ADD CONSTRAINT `tags_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
COMMIT;

