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

START TRANSACTION;



--
-- Database: `cslancer_wechat`
--

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

--
-- Table structure for table `chats`
--

CREATE TABLE `chats` (
  `id` bigint UNSIGNED NOT NULL,
  `created_by` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_private` 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 `chats`
--

INSERT INTO `chats` (`id`, `created_by`, `name`, `is_private`, `created_at`, `updated_at`) VALUES
(1, 1, NULL, 1, '2024-08-17 10:33:21', '2024-08-25 17:04:12'),
(2, 1, NULL, 1, '2024-08-18 09:47:17', '2024-08-25 12:57:34'),
(3, 2, NULL, 1, '2024-08-24 07:30:21', '2024-08-24 07:40:31'),
(4, 1, NULL, 1, '2024-08-24 07:40:12', '2024-08-24 07:41:07');

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

--
-- Table structure for table `chat_messages`
--

CREATE TABLE `chat_messages` (
  `id` bigint UNSIGNED NOT NULL,
  `chat_id` bigint UNSIGNED NOT NULL,
  `user_id` bigint UNSIGNED NOT NULL,
  `message` text COLLATE utf8mb4_unicode_ci,
  `reply` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `file` varchar(10000) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` varchar(10) COLLATE utf8mb4_unicode_ci 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 `chat_messages`
--

INSERT INTO `chat_messages` (`id`, `chat_id`, `user_id`, `message`, `reply`, `file`, `status`, `created_at`, `updated_at`) VALUES
(1, 1, 2, 'Hello', NULL, NULL, '2', '2024-08-22 13:17:01', '2024-08-22 13:17:01'),
(2, 1, 1, 'hy', NULL, NULL, '2', '2024-08-22 13:17:35', '2024-08-22 13:17:35'),
(3, 1, 2, 'What are you doing', NULL, NULL, '2', '2024-08-22 13:17:50', '2024-08-22 13:17:50'),
(4, 1, 1, 'nothing', NULL, NULL, '2', '2024-08-22 13:17:57', '2024-08-22 13:17:57'),
(5, 1, 2, 'What are you doing?', NULL, NULL, '2', '2024-08-22 13:18:04', '2024-08-22 13:18:04'),
(6, 1, 2, NULL, NULL, 'https://wechat.cslancer.com/public/files/2024-08-22_13-18-18iphone_quiet_ring.mp3', '2', '2024-08-22 13:18:18', '2024-08-22 13:18:18'),
(7, 1, 1, 'Testing', NULL, NULL, '2', '2024-08-22 16:22:59', '2024-08-22 16:22:59'),
(8, 1, 1, NULL, NULL, 'https://wechat.cslancer.com/public/files/2024-08-22_16-23-271724343786293.aac', '2', '2024-08-22 16:23:30', '2024-08-22 16:23:30'),
(9, 1, 1, '😆😆🤣😅', NULL, NULL, '2', '2024-08-22 16:24:13', '2024-08-22 16:24:13'),
(10, 1, 2, 'hello', NULL, NULL, '2', '2024-08-22 16:26:03', '2024-08-22 16:26:03'),
(11, 1, 2, 'What are you doing?', 'nothing', NULL, '2', '2024-08-22 16:30:44', '2024-08-22 16:30:44'),
(12, 1, 2, 'Testing', 'nothing', NULL, '2', '2024-08-22 16:31:26', '2024-08-22 16:31:26'),
(13, 1, 2, NULL, NULL, 'https://wechat.cslancer.com/public/files/2024-08-22_16-32-381000000277.jpg', '2', '2024-08-22 16:32:38', '2024-08-22 16:32:38'),
(14, 1, 2, NULL, NULL, 'https://wechat.cslancer.com/public/files/2024-08-22_16-33-381000000221.jpg', '2', '2024-08-22 16:33:38', '2024-08-22 16:33:38'),
(15, 1, 2, NULL, NULL, NULL, '2', '2024-08-22 16:37:39', '2024-08-22 16:37:39'),
(16, 1, 2, NULL, NULL, 'https://wechat.cslancer.com/public/files/2024-08-22_16-38-201000000562.jpg', '2', '2024-08-22 16:38:20', '2024-08-22 16:38:20'),
(17, 1, 1, 'hi', NULL, NULL, '2', '2024-08-22 16:40:48', '2024-08-22 16:40:48'),
(18, 1, 1, 'ghh', NULL, NULL, '2', '2024-08-22 18:20:45', '2024-08-22 18:20:45'),
(19, 1, 1, 'abc', NULL, NULL, '2', '2024-08-22 18:20:50', '2024-08-22 18:20:50'),
(20, 1, 1, 'def', NULL, NULL, '2', '2024-08-22 18:20:55', '2024-08-22 18:20:55'),
(21, 1, 1, 'testing', NULL, NULL, '2', '2024-08-22 18:21:01', '2024-08-22 18:21:01'),
(22, 1, 1, 'what', NULL, NULL, '2', '2024-08-22 18:21:06', '2024-08-22 18:21:06'),
(23, 1, 1, 'yi', NULL, NULL, '2', '2024-08-22 18:21:41', '2024-08-22 18:21:41'),
(24, 1, 1, 'yasd', NULL, NULL, '2', '2024-08-22 18:21:47', '2024-08-22 18:21:47'),
(25, 1, 1, 'adg', NULL, NULL, '2', '2024-08-22 18:21:51', '2024-08-22 18:21:51'),
(26, 1, 1, 'uu', NULL, NULL, '2', '2024-08-22 18:21:56', '2024-08-22 18:21:56'),
(27, 1, 1, 'yui', NULL, NULL, '2', '2024-08-22 18:22:01', '2024-08-22 18:22:01'),
(28, 1, 1, 'Hi', NULL, NULL, '2', '2024-08-23 03:32:01', '2024-08-23 03:32:01'),
(29, 1, 1, 'Hi', NULL, NULL, '2', '2024-08-23 03:32:14', '2024-08-23 03:32:14'),
(30, 2, 1, 'hello', NULL, NULL, '1', '2024-08-24 07:35:02', '2024-08-24 07:35:02'),
(31, 3, 1, 'hello', NULL, NULL, '1', '2024-08-24 07:40:31', '2024-08-24 07:40:31'),
(32, 4, 4, 'hello', NULL, NULL, '2', '2024-08-24 07:41:07', '2024-08-24 07:41:07'),
(33, 1, 2, 'hello', NULL, NULL, '2', '2024-08-24 08:39:37', '2024-08-24 08:39:37'),
(34, 1, 2, NULL, NULL, 'https://wechat.cslancer.com/public/files/2024-08-24_08-54-021000193830.jpg', '2', '2024-08-24 08:54:02', '2024-08-24 08:54:02'),
(35, 1, 2, 'Hi', 'hy', NULL, '2', '2024-08-24 09:26:26', '2024-08-24 09:26:26'),
(85, 1, 1, NULL, NULL, 'https://wechat.cslancer.com/public/files/2024-08-25_02-25-151000000472.jpg', '2', '2024-08-25 02:25:15', '2024-08-25 02:25:15'),
(86, 1, 1, NULL, NULL, NULL, '2', '2024-08-25 02:26:08', '2024-08-25 02:26:08'),
(87, 1, 1, NULL, NULL, 'https://wechat.cslancer.com/public/files/2024-08-25_02-26-361724552779523.aac', '2', '2024-08-25 02:26:36', '2024-08-25 02:26:36'),
(88, 1, 1, 'https://wechat.cslancer.com/public/files/2024-08-24_08-54-021000193830.jpg', 'Hi', NULL, '2', '2024-08-25 02:28:28', '2024-08-25 02:28:28'),
(89, 2, 1, 'Hello', NULL, NULL, '1', '2024-08-25 02:29:41', '2024-08-25 02:29:41'),
(90, 1, 2, 'hello', NULL, NULL, '2', '2024-08-25 03:04:04', '2024-08-25 03:04:04'),
(91, 1, 2, 'Hello', NULL, NULL, '2', '2024-08-25 03:04:35', '2024-08-25 03:04:35'),
(92, 1, 2, 'test message', NULL, NULL, '2', '2024-08-25 03:05:15', '2024-08-25 03:05:15'),
(93, 1, 2, NULL, NULL, NULL, '2', '2024-08-25 03:08:20', '2024-08-25 03:08:20'),
(94, 1, 2, NULL, NULL, NULL, '2', '2024-08-25 03:09:20', '2024-08-25 03:09:20'),
(95, 1, 2, NULL, NULL, NULL, '2', '2024-08-25 03:10:13', '2024-08-25 03:10:13'),
(96, 1, 2, 'checking', NULL, NULL, '2', '2024-08-25 03:10:47', '2024-08-25 03:10:47'),
(97, 1, 1, NULL, NULL, NULL, '2', '2024-08-25 03:12:57', '2024-08-25 03:12:57'),
(98, 1, 2, 'Hello demo1', NULL, NULL, '2', '2024-08-25 03:17:15', '2024-08-25 03:17:15'),
(99, 1, 2, 'testing read message', NULL, NULL, '2', '2024-08-25 03:19:47', '2024-08-25 03:19:47'),
(100, 1, 2, 'hello', NULL, NULL, '2', '2024-08-25 12:23:54', '2024-08-25 12:23:54'),
(101, 1, 1, 'hello', NULL, NULL, '2', '2024-08-25 12:25:36', '2024-08-25 12:25:36'),
(102, 1, 1, 'hy', NULL, NULL, '2', '2024-08-25 12:26:01', '2024-08-25 12:26:01'),
(103, 1, 2, 'nice', NULL, NULL, '2', '2024-08-25 12:26:44', '2024-08-25 12:26:44'),
(104, 1, 2, 'hello', NULL, NULL, '2', '2024-08-25 12:37:34', '2024-08-25 12:37:34'),
(105, 1, 1, 'hy', NULL, NULL, '2', '2024-08-25 12:38:57', '2024-08-25 12:38:57'),
(106, 1, 1, 'ht', NULL, NULL, '2', '2024-08-25 12:42:26', '2024-08-25 12:42:26'),
(107, 1, 1, 'nice', NULL, NULL, '2', '2024-08-25 12:43:09', '2024-08-25 12:43:09'),
(108, 1, 2, 'hello', NULL, NULL, '2', '2024-08-25 12:43:58', '2024-08-25 12:43:58'),
(109, 1, 2, 'hello', NULL, NULL, '2', '2024-08-25 12:44:56', '2024-08-25 12:44:56'),
(110, 1, 2, 'hellos', NULL, NULL, '2', '2024-08-25 12:46:16', '2024-08-25 12:46:16'),
(111, 1, 2, 'by', NULL, NULL, '2', '2024-08-25 12:46:48', '2024-08-25 12:46:48'),
(112, 1, 2, 'nice to meet you', NULL, NULL, '2', '2024-08-25 12:47:08', '2024-08-25 12:47:08'),
(113, 2, 3, 'by', NULL, NULL, '1', '2024-08-25 12:47:58', '2024-08-25 12:47:58'),
(114, 2, 3, 'hy', NULL, NULL, '1', '2024-08-25 12:49:14', '2024-08-25 12:49:14'),
(115, 2, 3, 'buy', NULL, NULL, '1', '2024-08-25 12:50:33', '2024-08-25 12:50:33'),
(116, 2, 3, 'hy', NULL, NULL, '1', '2024-08-25 12:51:04', '2024-08-25 12:51:04'),
(117, 2, 3, 'nice', NULL, NULL, '1', '2024-08-25 12:53:39', '2024-08-25 12:53:39'),
(118, 2, 3, 'hello', NULL, NULL, '1', '2024-08-25 12:55:39', '2024-08-25 12:55:39'),
(119, 2, 3, 'heloo', NULL, NULL, '1', '2024-08-25 12:56:12', '2024-08-25 12:56:12'),
(120, 2, 3, 'heelo', NULL, NULL, '1', '2024-08-25 12:56:57', '2024-08-25 12:56:57'),
(121, 2, 3, 'hello', NULL, NULL, '1', '2024-08-25 12:57:34', '2024-08-25 12:57:34'),
(122, 1, 2, 'hey', NULL, NULL, '2', '2024-08-25 12:59:16', '2024-08-25 12:59:16'),
(123, 1, 2, 'hello', NULL, NULL, '2', '2024-08-25 13:00:56', '2024-08-25 13:00:56'),
(124, 1, 1, 'by', NULL, NULL, '2', '2024-08-25 13:01:03', '2024-08-25 13:01:03'),
(125, 1, 2, 'bbbb', NULL, NULL, '2', '2024-08-25 13:01:56', '2024-08-25 13:01:56'),
(126, 1, 2, 'hello', NULL, NULL, '2', '2024-08-25 13:03:10', '2024-08-25 13:03:10'),
(127, 1, 2, 'heelo', NULL, NULL, '2', '2024-08-25 13:03:56', '2024-08-25 13:03:56'),
(128, 1, 2, 'nuce', NULL, NULL, '2', '2024-08-25 13:04:47', '2024-08-25 13:04:47'),
(129, 1, 2, 'by', NULL, NULL, '2', '2024-08-25 13:05:05', '2024-08-25 13:05:05'),
(130, 1, 2, 'hey', NULL, NULL, '2', '2024-08-25 13:05:37', '2024-08-25 13:05:37'),
(131, 1, 1, 'go', NULL, NULL, '2', '2024-08-25 13:05:46', '2024-08-25 13:05:46'),
(132, 1, 2, 'where', NULL, NULL, '2', '2024-08-25 13:05:54', '2024-08-25 13:05:54'),
(133, 1, 1, 'nice', NULL, NULL, '2', '2024-08-25 13:18:21', '2024-08-25 13:18:21'),
(134, 1, 1, 'by', NULL, NULL, '2', '2024-08-25 13:18:32', '2024-08-25 13:18:32'),
(135, 1, 1, 'go', NULL, NULL, '2', '2024-08-25 13:18:49', '2024-08-25 13:18:49'),
(136, 1, 1, 'hy', NULL, NULL, '2', '2024-08-25 13:19:20', '2024-08-25 13:19:20'),
(137, 1, 1, 'go', NULL, NULL, '2', '2024-08-25 13:21:13', '2024-08-25 13:21:13'),
(138, 1, 1, 'hy', NULL, NULL, '2', '2024-08-25 13:22:48', '2024-08-25 13:22:48'),
(139, 1, 1, 'by', NULL, NULL, '2', '2024-08-25 13:22:59', '2024-08-25 13:22:59'),
(140, 1, 2, 'hello', NULL, NULL, '2', '2024-08-25 13:23:31', '2024-08-25 13:23:31'),
(141, 1, 2, 'nice', NULL, NULL, '2', '2024-08-25 13:24:30', '2024-08-25 13:24:30'),
(142, 1, 1, 'by', NULL, NULL, '2', '2024-08-25 13:24:38', '2024-08-25 13:24:38'),
(143, 1, 1, 'by', NULL, NULL, '2', '2024-08-25 13:24:55', '2024-08-25 13:24:55'),
(144, 1, 2, 'hoo', NULL, NULL, '2', '2024-08-25 13:29:26', '2024-08-25 13:29:26'),
(145, 1, 2, 'by', NULL, NULL, '2', '2024-08-25 13:29:54', '2024-08-25 13:29:54'),
(146, 1, 2, 'bbb', NULL, NULL, '2', '2024-08-25 13:30:59', '2024-08-25 13:30:59'),
(147, 1, 2, 'cccc', NULL, NULL, '2', '2024-08-25 13:31:57', '2024-08-25 13:31:57'),
(148, 1, 2, 'by', NULL, NULL, '2', '2024-08-25 13:33:25', '2024-08-25 13:33:25'),
(149, 1, 2, 'hy', NULL, NULL, '2', '2024-08-25 13:40:04', '2024-08-25 13:40:04'),
(150, 1, 1, 'hello', NULL, NULL, '2', '2024-08-25 13:40:17', '2024-08-25 13:40:17'),
(151, 1, 2, 'bbbb', NULL, NULL, '2', '2024-08-25 13:41:45', '2024-08-25 13:41:45'),
(152, 1, 2, 'nice', NULL, NULL, '2', '2024-08-25 13:44:53', '2024-08-25 13:44:53'),
(153, 1, 1, 'np', NULL, NULL, '2', '2024-08-25 13:45:03', '2024-08-25 13:45:03'),
(154, 1, 2, 'hello', NULL, NULL, '2', '2024-08-25 13:46:29', '2024-08-25 13:46:29'),
(155, 1, 1, 'morning', NULL, NULL, '2', '2024-08-25 13:46:40', '2024-08-25 13:46:40'),
(156, 1, 2, 'hy', NULL, NULL, '2', '2024-08-25 13:53:47', '2024-08-25 13:53:47'),
(157, 1, 2, 'nice', NULL, NULL, '2', '2024-08-25 13:53:53', '2024-08-25 13:53:53'),
(158, 1, 1, 'how', NULL, NULL, '2', '2024-08-25 13:53:59', '2024-08-25 13:53:59'),
(159, 1, 1, 'by', NULL, NULL, '2', '2024-08-25 13:54:13', '2024-08-25 13:54:13'),
(160, 1, 1, 'hello', NULL, NULL, '2', '2024-08-25 13:55:19', '2024-08-25 13:55:19'),
(161, 1, 2, 'nnn', NULL, NULL, '2', '2024-08-25 13:55:26', '2024-08-25 13:55:26'),
(162, 1, 1, 'by', NULL, NULL, '2', '2024-08-25 13:56:19', '2024-08-25 13:56:19'),
(163, 1, 1, 'how', NULL, NULL, '2', '2024-08-25 13:56:29', '2024-08-25 13:56:29'),
(164, 1, 2, 'heello', NULL, NULL, '2', '2024-08-25 14:03:11', '2024-08-25 14:03:11'),
(165, 1, 1, 'see', NULL, NULL, '2', '2024-08-25 14:04:59', '2024-08-25 14:04:59'),
(166, 1, 2, 'hello', NULL, NULL, '2', '2024-08-25 14:06:29', '2024-08-25 14:06:29'),
(167, 1, 1, 'hy', NULL, NULL, '2', '2024-08-25 14:06:42', '2024-08-25 14:06:42'),
(168, 1, 2, 'hello', NULL, NULL, '2', '2024-08-25 14:16:37', '2024-08-25 14:16:37'),
(169, 1, 1, 'HH', NULL, NULL, '2', '2024-08-25 14:16:51', '2024-08-25 14:16:51'),
(170, 1, 2, 'good', NULL, NULL, '2', '2024-08-25 14:18:12', '2024-08-25 14:18:12'),
(171, 1, 1, 'by', NULL, NULL, '2', '2024-08-25 14:18:18', '2024-08-25 14:18:18'),
(172, 1, 2, 'hello', NULL, NULL, '2', '2024-08-25 14:23:32', '2024-08-25 14:23:32'),
(173, 1, 2, 'hello', NULL, NULL, '2', '2024-08-25 14:26:19', '2024-08-25 14:26:19'),
(174, 1, 1, 'dee', NULL, NULL, '2', '2024-08-25 14:26:27', '2024-08-25 14:26:27'),
(175, 1, 2, 'hy', NULL, NULL, '2', '2024-08-25 14:27:38', '2024-08-25 14:27:38'),
(176, 1, 1, 'h', NULL, NULL, '2', '2024-08-25 14:27:43', '2024-08-25 14:27:43'),
(177, 1, 2, 'by', NULL, NULL, '2', '2024-08-25 14:35:49', '2024-08-25 14:35:49'),
(178, 1, 1, 'see you soon', NULL, NULL, '2', '2024-08-25 14:35:57', '2024-08-25 14:35:57'),
(179, 1, 2, 'hy', NULL, NULL, '2', '2024-08-25 14:49:16', '2024-08-25 14:49:16'),
(180, 1, 1, 'go', NULL, NULL, '2', '2024-08-25 14:49:29', '2024-08-25 14:49:29'),
(181, 1, 2, 'hy', NULL, NULL, '2', '2024-08-25 14:50:45', '2024-08-25 14:50:45'),
(182, 1, 2, 'go', NULL, NULL, '2', '2024-08-25 14:51:40', '2024-08-25 14:51:40'),
(183, 1, 1, 'hello', NULL, NULL, '2', '2024-08-25 14:53:15', '2024-08-25 14:53:15'),
(184, 1, 1, 'go', NULL, NULL, '2', '2024-08-25 14:53:24', '2024-08-25 14:53:24'),
(185, 1, 1, 'hy', NULL, NULL, '2', '2024-08-25 14:55:22', '2024-08-25 14:55:22'),
(186, 1, 2, 'by', NULL, NULL, '2', '2024-08-25 14:55:31', '2024-08-25 14:55:31'),
(187, 1, 2, 'yy', NULL, NULL, '2', '2024-08-25 14:56:06', '2024-08-25 14:56:06'),
(188, 1, 1, 'jj', NULL, NULL, '2', '2024-08-25 14:56:13', '2024-08-25 14:56:13'),
(189, 1, 2, 'hello', NULL, NULL, '2', '2024-08-25 15:01:19', '2024-08-25 15:01:19'),
(190, 1, 1, 'hello', NULL, NULL, '2', '2024-08-25 15:02:34', '2024-08-25 15:02:34'),
(191, 1, 2, 'hy', NULL, NULL, '2', '2024-08-25 15:03:09', '2024-08-25 15:03:09'),
(192, 1, 2, 'hy', NULL, NULL, '2', '2024-08-25 15:18:42', '2024-08-25 15:18:42'),
(193, 1, 1, 'good', NULL, NULL, '2', '2024-08-25 15:18:53', '2024-08-25 15:18:53'),
(194, 1, 2, 'hy', NULL, NULL, '2', '2024-08-25 15:22:19', '2024-08-25 15:22:19'),
(195, 1, 2, 'nice', NULL, NULL, '2', '2024-08-25 15:26:21', '2024-08-25 15:26:21'),
(196, 1, 1, 'good', NULL, NULL, '2', '2024-08-25 15:26:28', '2024-08-25 15:26:28'),
(197, 1, 2, 'hello', NULL, NULL, '2', '2024-08-25 15:32:20', '2024-08-25 15:32:20'),
(198, 1, 2, 'go', NULL, NULL, '2', '2024-08-25 15:32:34', '2024-08-25 15:32:34'),
(199, 1, 2, 'hello', NULL, NULL, '2', '2024-08-25 16:52:40', '2024-08-25 16:52:40'),
(200, 1, 2, 'hello', NULL, NULL, '2', '2024-08-25 16:52:51', '2024-08-25 16:52:51'),
(201, 1, 2, 'hello', NULL, NULL, '2', '2024-08-25 17:01:01', '2024-08-25 17:01:01'),
(202, 1, 2, 'hello', NULL, NULL, '1', '2024-08-25 17:04:12', '2024-08-25 17:04:12');

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

--
-- Table structure for table `chat_participants`
--

CREATE TABLE `chat_participants` (
  `id` bigint UNSIGNED NOT NULL,
  `chat_id` bigint UNSIGNED NOT NULL,
  `user_id` bigint UNSIGNED NOT NULL,
  `watch` tinyint 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 `chat_participants`
--

INSERT INTO `chat_participants` (`id`, `chat_id`, `user_id`, `watch`, `created_at`, `updated_at`) VALUES
(1, 1, 1, 0, '2024-08-17 10:33:21', '2024-08-17 10:33:21'),
(2, 1, 2, 1, '2024-08-17 10:33:21', '2024-08-17 10:33:21'),
(3, 2, 1, 0, '2024-08-18 09:47:17', '2024-08-18 09:47:17'),
(4, 2, 3, 0, '2024-08-18 09:47:17', '2024-08-18 09:47:17'),
(5, 3, 2, 0, '2024-08-24 07:30:21', '2024-08-24 07:30:21'),
(6, 3, 3, 0, '2024-08-24 07:30:21', '2024-08-24 07:30:21'),
(7, 4, 1, 0, '2024-08-24 07:40:12', '2024-08-24 07:40:12'),
(8, 4, 4, 0, '2024-08-24 07:40:12', '2024-08-24 07:40:12');

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

--
-- Table structure for table `failed_jobs`
--

CREATE TABLE `failed_jobs` (
  `id` bigint UNSIGNED NOT NULL,
  `uuid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `connection` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `queue` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `favorite_chat`
--

CREATE TABLE `favorite_chat` (
  `id` int NOT NULL,
  `user_id` int NOT NULL,
  `chat_id` int NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `favorite_chat`
--

INSERT INTO `favorite_chat` (`id`, `user_id`, `chat_id`, `created_at`, `updated_at`) VALUES
(26, 1, 2, '2024-08-21 12:59:38', '2024-08-21 12:59:38'),
(43, 1, 1, '2024-08-25 02:29:25', '2024-08-25 02:29:25');

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

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

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

--
-- Dumping data for table `migrations`
--

INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2014_10_12_000000_create_users_table', 1),
(2, '2014_10_12_100000_create_password_resets_table', 1),
(3, '2019_08_19_000000_create_failed_jobs_table', 1),
(4, '2019_12_14_000001_create_personal_access_tokens_table', 1),
(5, '2022_09_15_143809_create_chats_table', 1),
(6, '2022_09_15_143828_create_chat_participants_table', 1),
(7, '2022_09_15_143842_create_chat_messages_table', 1);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `chats`
--
ALTER TABLE `chats`
  ADD PRIMARY KEY (`id`),
  ADD KEY `chats_created_by_foreign` (`created_by`);

--
-- Indexes for table `chat_messages`
--
ALTER TABLE `chat_messages`
  ADD PRIMARY KEY (`id`),
  ADD KEY `chat_messages_chat_id_foreign` (`chat_id`),
  ADD KEY `chat_messages_user_id_foreign` (`user_id`);

--
-- Indexes for table `chat_participants`
--
ALTER TABLE `chat_participants`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `chat_participants_chat_id_user_id_unique` (`chat_id`,`user_id`),
  ADD KEY `chat_participants_user_id_foreign` (`user_id`);

--
-- Indexes for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`);

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

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

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `chats`
--
ALTER TABLE `chats`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `chat_messages`
--
ALTER TABLE `chat_messages`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=203;

--
-- AUTO_INCREMENT for table `chat_participants`
--
ALTER TABLE `chat_participants`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `favorite_chat`
--
ALTER TABLE `favorite_chat`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=44;

--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `chats`
--
ALTER TABLE `chats`
  ADD CONSTRAINT `chats_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `chat_messages`
--
ALTER TABLE `chat_messages`
  ADD CONSTRAINT `chat_messages_chat_id_foreign` FOREIGN KEY (`chat_id`) REFERENCES `chats` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `chat_messages_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `chat_participants`
--
ALTER TABLE `chat_participants`
  ADD CONSTRAINT `chat_participants_chat_id_foreign` FOREIGN KEY (`chat_id`) REFERENCES `chats` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `chat_participants_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
COMMIT;

