From 42490aaf370d4a761c18afa10207d4292c0b9210 Mon Sep 17 00:00:00 2001 From: Lncvrt Date: Sun, 24 Aug 2025 21:58:57 -0700 Subject: [PATCH] Update database --- database.sql | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/database.sql b/database.sql index b885605..c217e3c 100644 --- a/database.sql +++ b/database.sql @@ -3,7 +3,7 @@ -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1:3306 --- Generation Time: Aug 25, 2025 at 02:54 AM +-- Generation Time: Aug 25, 2025 at 06:58 AM -- Server version: 11.8.3-MariaDB-ubu2404 -- PHP Version: 8.1.33 @@ -23,6 +23,20 @@ SET time_zone = "+00:00"; -- -------------------------------------------------------- +-- +-- Table structure for table `chatroom_reports` +-- + +CREATE TABLE `chatroom_reports` ( + `id` int(11) NOT NULL, + `chatId` int(11) NOT NULL, + `userId` int(11) NOT NULL, + `reason` text NOT NULL, + `timestamp` bigint(20) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPRESSED; + +-- -------------------------------------------------------- + -- -- Table structure for table `chats` -- @@ -104,6 +118,14 @@ CREATE TABLE `users` ( -- Indexes for dumped tables -- +-- +-- Indexes for table `chatroom_reports` +-- +ALTER TABLE `chatroom_reports` + ADD PRIMARY KEY (`id`), + ADD KEY `userId` (`userId`), + ADD KEY `chatId` (`chatId`); + -- -- Indexes for table `chats` -- @@ -134,6 +156,12 @@ ALTER TABLE `users` -- AUTO_INCREMENT for dumped tables -- +-- +-- AUTO_INCREMENT for table `chatroom_reports` +-- +ALTER TABLE `chatroom_reports` + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; + -- -- AUTO_INCREMENT for table `chats` -- @@ -162,6 +190,13 @@ ALTER TABLE `users` -- Constraints for dumped tables -- +-- +-- Constraints for table `chatroom_reports` +-- +ALTER TABLE `chatroom_reports` + ADD CONSTRAINT `chatId` FOREIGN KEY (`chatId`) REFERENCES `chats` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + ADD CONSTRAINT `userId` FOREIGN KEY (`userId`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; + -- -- Constraints for table `chats` --