-- phpMyAdmin SQL Dump -- version 5.2.2 -- https://www.phpmyadmin.net/ -- -- Host: localhost:3306 -- Generation Time: Dec 09, 2025 at 04:00 PM -- Server version: 10.5.29-MariaDB -- PHP Version: 8.4.14 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `doctorkif_supportboard` -- -- -------------------------------------------------------- -- -- Table structure for table `sb_conversations` -- CREATE TABLE `sb_conversations` ( `id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `title` varchar(191) DEFAULT NULL, `creation_time` datetime NOT NULL, `status_code` tinyint(4) DEFAULT 0, `department` tinyint(4) DEFAULT NULL, `agent_id` int(11) DEFAULT NULL, `source` varchar(2) DEFAULT NULL, `extra` varchar(191) DEFAULT NULL, `extra_2` varchar(191) DEFAULT NULL, `tags` varchar(191) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `sb_conversations` -- -- -------------------------------------------------------- -- -- Table structure for table `sb_messages` -- CREATE TABLE `sb_messages` ( `id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `message` text NOT NULL, `creation_time` datetime NOT NULL, `status_code` tinyint(4) DEFAULT 0, `attachments` text DEFAULT NULL, `payload` text DEFAULT NULL, `conversation_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; -- -- Dumping data for table `sb_messages` -- -- -------------------------------------------------------- -- -- Table structure for table `sb_reports` -- CREATE TABLE `sb_reports` ( `id` int(11) NOT NULL, `name` varchar(191) NOT NULL, `value` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `creation_time` date NOT NULL, `external_id` int(11) DEFAULT NULL, `extra` varchar(191) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `sb_reports` -- -- -------------------------------------------------------- -- -- Table structure for table `sb_settings` -- CREATE TABLE `sb_settings` ( `name` varchar(191) NOT NULL, `value` longtext DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `sb_settings` -- -- -------------------------------------------------------- -- -- Table structure for table `sb_users` -- CREATE TABLE `sb_users` ( `id` int(11) NOT NULL, `first_name` varchar(100) NOT NULL, `last_name` varchar(100) NOT NULL, `password` varchar(100) DEFAULT NULL, `email` varchar(191) DEFAULT NULL, `profile_image` varchar(191) DEFAULT NULL, `user_type` varchar(10) NOT NULL, `creation_time` datetime NOT NULL, `token` varchar(50) NOT NULL, `last_activity` datetime DEFAULT NULL, `typing` int(11) DEFAULT -1, `department` tinyint(4) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `sb_users` -- -- -------------------------------------------------------- -- -- Table structure for table `sb_users_data` -- CREATE TABLE `sb_users_data` ( `id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `slug` varchar(191) NOT NULL, `name` varchar(191) NOT NULL, `value` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `sb_users_data` -- -- -- Indexes for dumped tables -- -- -- Indexes for table `sb_conversations` -- ALTER TABLE `sb_conversations` ADD PRIMARY KEY (`id`), ADD KEY `agent_id` (`agent_id`), ADD KEY `user_id` (`user_id`); -- -- Indexes for table `sb_messages` -- ALTER TABLE `sb_messages` ADD PRIMARY KEY (`id`), ADD KEY `user_id` (`user_id`), ADD KEY `conversation_id` (`conversation_id`); -- -- Indexes for table `sb_reports` -- ALTER TABLE `sb_reports` ADD PRIMARY KEY (`id`); -- -- Indexes for table `sb_settings` -- ALTER TABLE `sb_settings` ADD PRIMARY KEY (`name`); -- -- Indexes for table `sb_users` -- ALTER TABLE `sb_users` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `token` (`token`), ADD UNIQUE KEY `email` (`email`); -- -- Indexes for table `sb_users_data` -- ALTER TABLE `sb_users_data` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `sb_users_data_index` (`user_id`,`slug`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `sb_conversations` -- ALTER TABLE `sb_conversations` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=38; -- -- AUTO_INCREMENT for table `sb_messages` -- ALTER TABLE `sb_messages` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=262; -- -- AUTO_INCREMENT for table `sb_reports` -- ALTER TABLE `sb_reports` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=151; -- -- AUTO_INCREMENT for table `sb_users` -- ALTER TABLE `sb_users` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=696; -- -- AUTO_INCREMENT for table `sb_users_data` -- ALTER TABLE `sb_users_data` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2143; -- -- Constraints for dumped tables -- -- -- Constraints for table `sb_conversations` -- ALTER TABLE `sb_conversations` ADD CONSTRAINT `sb_conversations_ibfk_1` FOREIGN KEY (`agent_id`) REFERENCES `sb_users` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `sb_conversations_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `sb_users` (`id`) ON DELETE CASCADE; -- -- Constraints for table `sb_messages` -- ALTER TABLE `sb_messages` ADD CONSTRAINT `sb_messages_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `sb_users` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `sb_messages_ibfk_2` FOREIGN KEY (`conversation_id`) REFERENCES `sb_conversations` (`id`) ON DELETE CASCADE; -- -- Constraints for table `sb_users_data` -- ALTER TABLE `sb_users_data` ADD CONSTRAINT `sb_users_data_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `sb_users` (`id`) ON DELETE CASCADE; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;