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

START TRANSACTION;



--
-- Database: `uniyatwoon`
--

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

--
-- Table structure for table `comments`
--

CREATE TABLE IF NOT EXISTS `comments` (
  `id` int NOT NULL AUTO_INCREMENT,
  `post_id` int NOT NULL,
  `Username` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `Description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `Parent_id` int DEFAULT NULL,
  `Created_at` datetime NOT NULL,
  `Updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `comments`
--

INSERT INTO `comments` (`id`, `post_id`, `Username`, `Description`, `Parent_id`, `Created_at`, `Updated_at`) VALUES
(1, 12, 'Aung Si Phyo', 'Fightin!', NULL, '2026-01-14 11:27:27', '0000-00-00 00:00:00'),
(2, 12, 'Aung Si Phyo', 'Fightin!', NULL, '2026-01-14 11:28:38', '0000-00-00 00:00:00'),
(3, 16, 'Aung Si Phyo', 'Fighting!!!', NULL, '2026-01-14 11:36:11', '0000-00-00 00:00:00');

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

--
-- Table structure for table `follows`
--

CREATE TABLE IF NOT EXISTS `follows` (
  `id` int NOT NULL AUTO_INCREMENT,
  `follower_uuid` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `following_uuid` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_follow` (`follower_uuid`,`following_uuid`),
  KEY `idx_follower` (`follower_uuid`),
  KEY `idx_following` (`following_uuid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `likes`
--

CREATE TABLE IF NOT EXISTS `likes` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_uuid` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `post_id` int NOT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_like` (`user_uuid`,`post_id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `likes`
--

INSERT INTO `likes` (`id`, `user_uuid`, `post_id`, `created_at`) VALUES
(1, 'af828da5-c414-47e9-aa02-d6ec12ebf853', 12, '2026-01-16 22:08:58');

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

--
-- Table structure for table `notifications`
--

CREATE TABLE IF NOT EXISTS `notifications` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_uuid` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `from_uuid` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `post_id` int DEFAULT NULL,
  `type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `message` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_read` tinyint(1) DEFAULT '0',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `notifications`
--

INSERT INTO `notifications` (`id`, `user_uuid`, `from_uuid`, `post_id`, `type`, `message`, `is_read`, `created_at`) VALUES
(1, '4db48c2f-ddb3-11f0-948a-b94321dcec09', 'af828da5-c414-47e9-aa02-d6ec12ebf853', 12, 'like', 'Your post was liked by Sitt Aung', 0, '2026-01-16 22:08:58');

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

--
-- Table structure for table `posts`
--

CREATE TABLE IF NOT EXISTS `posts` (
  `id` int NOT NULL AUTO_INCREMENT,
  `Username` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `User_uuid` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `Description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `Created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `Updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `type` enum('normal','lost_found','announcement') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'normal',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `posts`
--

INSERT INTO `posts` (`id`, `Username`, `User_uuid`, `Description`, `Created_at`, `Updated_at`, `type`) VALUES
(12, 'Aung Si Phyo', '4db48c2f-ddb3-11f0-948a-b94321dcec09', 'TTU Project 2', '2025-12-25 20:42:23', '2025-12-25 20:42:23', 'normal'),
(16, 'Aung Si Phyo', '4db48c2f-ddb3-11f0-948a-b94321dcec09', 'Welcome to our uniyatwoon project,we been doing this project for about month.It will be published too soon.Stay Tuned!', '2026-01-09 18:44:00', '2026-01-14 18:07:18', 'announcement'),
(24, 'UniYatwoon_Admin', '41d5bf4b-3791-4c10-a492-d44dd35ee217', 'Do u Let Your Friends Know Uniyatwoon?', '2026-01-15 20:47:06', '2026-01-15 20:47:06', 'announcement'),
(26, 'Aung Si Phyo', '4db48c2f-ddb3-11f0-948a-b94321dcec09', 'Come and join the art club.Its so fun!!!', '2026-01-16 12:03:51', '2026-01-16 12:03:51', 'normal');

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

--
-- Table structure for table `posts_media`
--

CREATE TABLE IF NOT EXISTS `posts_media` (
  `Id` int NOT NULL AUTO_INCREMENT,
  `Post_id` int NOT NULL,
  `Media_url` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `Media_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=MyISAM AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `posts_media`
--

INSERT INTO `posts_media` (`Id`, `Post_id`, `Media_url`, `Media_type`) VALUES
(10, 11, 'uploads/1766671607_draw sql 1.PNG', 'image'),
(11, 12, 'uploads/1766671943_1st video.mp4', 'video'),
(12, 13, 'uploads/1766840764_music 2.jpg', 'image'),
(13, 13, 'uploads/1766840764_music 1.jpg', 'image'),
(14, 14, 'uploads/1766840938_grad 3.jpg', 'image'),
(15, 14, 'uploads/1766840938_grad 2.jpg', 'image'),
(16, 14, 'uploads/1766840938_grad 1.jpg', 'image'),
(17, 15, 'uploads/1766841007_art 2.jpg', 'image'),
(18, 15, 'uploads/1766841007_art 1.jpg', 'image'),
(19, 16, 'uploads/1767960840_webDeveloper.jpg', 'image'),
(20, 17, 'uploads/1768058972_webDeveloper.jpg', 'image'),
(21, 18, 'uploads/1768310295_Capture.PNG', 'image');

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

--
-- Table structure for table `report_posts`
--

CREATE TABLE IF NOT EXISTS `report_posts` (
  `id` int NOT NULL AUTO_INCREMENT,
  `Reporter_username` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `Reporter_user_uuid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `Reported_post_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `Reason` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `report_posts`
--

INSERT INTO `report_posts` (`id`, `Reporter_username`, `Reporter_user_uuid`, `Reported_post_id`, `Reason`) VALUES
(18, 'Sitt Aung', 'af828da5-c414-47e9-aa02-d6ec12ebf853', '12', 'Spam'),
(14, 'Sitt Aung', 'af828da5-c414-47e9-aa02-d6ec12ebf853', '12', 'Spam'),
(15, 'Sitt Aung', 'af828da5-c414-47e9-aa02-d6ec12ebf853', '12', 'Spam'),
(16, 'Sitt Aung', 'af828da5-c414-47e9-aa02-d6ec12ebf853', '12', 'nudity'),
(17, 'Sitt Aung', 'af828da5-c414-47e9-aa02-d6ec12ebf853', '12', 'Spam');

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

--
-- Table structure for table `savedposts`
--

CREATE TABLE IF NOT EXISTS `savedposts` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_uuid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `post_id` int NOT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_saved` (`user_uuid`,`post_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `search_history`
--

CREATE TABLE IF NOT EXISTS `search_history` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_uuid` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `search_text` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `target_uuid` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `target_type` enum('query','user','post') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'query',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user_uuid` (`user_uuid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
COMMIT;

