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

START TRANSACTION;



--
-- Database: `diginspire_reel`
--

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

--
-- Table structure for table `categories`
--

CREATE TABLE `categories` (
  `id` int NOT NULL,
  `name` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `categories`
--

INSERT INTO `categories` (`id`, `name`, `created_at`, `updated_at`) VALUES
(1, 'Music', '2024-11-22 05:12:31', '2024-11-22 05:12:31'),
(2, 'Sports', '2024-11-22 05:12:31', '2024-11-22 05:12:31'),
(3, 'Comedy', '2024-11-22 05:12:31', '2024-11-22 05:12:31'),
(4, 'Technology', '2024-11-22 05:12:31', '2024-11-22 05:12:31'),
(5, 'Education', '2024-11-22 05:12:31', '2024-11-22 05:12:31'),
(6, 'Lifestyle', '2024-11-22 05:12:31', '2024-11-22 05:12:31'),
(7, 'Travel', '2024-11-22 05:12:31', '2024-11-22 05:12:31'),
(8, 'Food', '2024-11-22 05:12:31', '2024-11-22 05:12:31'),
(9, 'Fashion', '2024-11-22 05:12:31', '2024-11-22 05:12:31'),
(10, 'Movies', '2024-11-22 05:12:31', '2024-11-22 05:12:31'),
(11, 'Health', '2024-11-22 05:12:31', '2024-11-22 05:12:31'),
(12, 'Gaming', '2024-11-22 05:12:31', '2024-11-22 05:12:31'),
(13, 'News', '2024-11-22 05:12:31', '2024-11-22 05:12:31'),
(14, 'Politics', '2024-11-22 05:12:31', '2024-11-22 05:12:31'),
(15, 'Science', '2024-11-22 05:12:31', '2024-11-22 05:12:31'),
(16, 'Art', '2024-11-22 05:12:31', '2024-11-22 05:12:31'),
(17, 'Books', '2024-11-22 05:12:31', '2024-11-22 05:12:31'),
(18, 'Music Videos', '2024-11-22 05:12:31', '2024-11-22 05:12:31'),
(19, 'Fitness', '2024-11-22 05:12:31', '2024-11-22 05:12:31'),
(20, 'Documentary', '2024-11-22 05:12:31', '2024-11-22 05:12:31');

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

--
-- Table structure for table `reels`
--

CREATE TABLE `reels` (
  `reel_id` int NOT NULL,
  `reel_link` varchar(255) NOT NULL,
  `category_id` int NOT NULL,
  `caption` varchar(255) NOT NULL,
  `user_id` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `reels`
--

INSERT INTO `reels` (`reel_id`, `reel_link`, `category_id`, `caption`, `user_id`) VALUES
(1, '1', 1, 'This is caption for reel 1', 1),
(2, '2', 2, 'This is caption for reel 2', 2),
(3, '3', 3, 'This is caption for reel 3', 3),
(4, '4', 4, 'This is caption for reel 4', 4),
(5, '5', 5, 'This is caption for reel 5', 5),
(6, '6', 6, 'This is caption for reel 6', 6),
(7, '7', 7, 'This is caption for reel 7', 7),
(8, '8', 8, 'This is caption for reel 8', 8),
(9, '9', 9, 'This is caption for reel 9', 9),
(10, '10', 10, 'This is caption for reel 10', 10),
(11, '11', 11, 'This is caption for reel 11', 11),
(12, '12', 12, 'This is caption for reel 12', 12),
(13, '13', 13, 'This is caption for reel 13', 13),
(14, '14', 14, 'This is caption for reel 14', 14),
(15, '15', 15, 'This is caption for reel 15', 15),
(16, '16', 16, 'This is caption for reel 16', 16),
(17, '17', 17, 'This is caption for reel 17', 17),
(18, '18', 18, 'This is caption for reel 18', 18),
(19, '19', 19, 'This is caption for reel 19', 19),
(20, '20', 20, 'This is caption for reel 20', 20),
(21, '21', 1, 'This is caption for reel 21', 21),
(22, '22', 1, 'This is caption for reel 22', 21),
(23, '23', 1, 'This is caption for reel 23', 21),
(24, '24', 2, 'This is caption for reel 24', 21),
(25, '25', 2, 'This is caption for reel 25', 21),
(26, '26', 2, 'This is caption for reel 26', 26),
(27, '27', 3, 'This is caption for reel 27', 27),
(28, '28', 3, 'This is caption for reel 28', 28),
(29, '29', 3, 'This is caption for reel 29', 29),
(30, '30', 1, 'This is caption for reel 30', 30),
(31, '31', 1, 'This is caption for reel 31', 31),
(32, '32', 1, 'This is caption for reel 32', 32),
(33, '33', 2, 'This is caption for reel 33', 33),
(34, '34', 2, 'This is caption for reel 34', 34),
(35, '35', 2, 'This is caption for reel 35', 35),
(36, '36', 3, 'This is caption for reel 36', 36),
(37, '37', 3, 'This is caption for reel 37', 37),
(38, '38', 3, 'This is caption for reel 38', 38),
(39, '39', 1, 'This is caption for reel 39', 39),
(40, '40', 1, 'This is caption for reel 40', 40),
(45, '1732275307_Video-469.mp4', 12, 'Gaming Reel', 23);

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

--
-- Table structure for table `user_categories`
--

CREATE TABLE `user_categories` (
  `user_id` int NOT NULL,
  `category_id` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `user_categories`
--

INSERT INTO `user_categories` (`user_id`, `category_id`) VALUES
(1, 1),
(3, 1),
(20, 1),
(23, 1),
(1, 2),
(3, 2),
(20, 2),
(23, 2),
(1, 3),
(3, 3),
(20, 3),
(1, 4),
(2, 4),
(23, 4),
(2, 5),
(23, 5),
(23, 6),
(4, 8),
(1, 9),
(4, 9),
(5, 10),
(23, 10),
(1, 11),
(5, 11),
(21, 11),
(23, 11),
(6, 12),
(23, 12),
(7, 13),
(7, 14),
(23, 14),
(8, 15),
(23, 15),
(8, 16),
(23, 16),
(9, 17),
(21, 17),
(23, 17),
(1, 18),
(9, 18),
(23, 18),
(10, 19),
(23, 19),
(10, 20),
(21, 20),
(23, 20);

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

--
-- Table structure for table `user_reel_likes`
--

CREATE TABLE `user_reel_likes` (
  `user_id` int NOT NULL,
  `reel_id` int NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `user_reel_likes`
--

INSERT INTO `user_reel_likes` (`user_id`, `reel_id`, `created_at`) VALUES
(1, 1, '2024-11-22 05:12:58'),
(1, 2, '2024-11-22 05:12:58'),
(2, 3, '2024-11-22 05:12:58'),
(2, 4, '2024-11-22 05:12:58'),
(3, 5, '2024-11-22 05:12:58'),
(4, 6, '2024-11-22 05:12:58'),
(4, 7, '2024-11-22 05:12:58'),
(5, 8, '2024-11-22 05:12:58'),
(5, 9, '2024-11-22 05:12:58'),
(6, 10, '2024-11-22 05:12:58'),
(6, 11, '2024-11-22 05:12:58'),
(7, 12, '2024-11-22 05:12:58'),
(7, 13, '2024-11-22 05:12:58'),
(8, 14, '2024-11-22 05:12:58'),
(8, 15, '2024-11-22 05:12:58'),
(9, 16, '2024-11-22 05:12:58'),
(9, 17, '2024-11-22 05:12:58'),
(10, 18, '2024-11-22 05:12:58'),
(10, 19, '2024-11-22 05:12:58'),
(11, 20, '2024-11-22 05:12:58'),
(20, 1, '2024-11-22 05:37:12'),
(20, 5, '2024-11-22 05:36:35');

--
-- Indexes for dumped tables
--

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

--
-- Indexes for table `reels`
--
ALTER TABLE `reels`
  ADD PRIMARY KEY (`reel_id`),
  ADD KEY `category_id` (`category_id`);

--
-- Indexes for table `user_categories`
--
ALTER TABLE `user_categories`
  ADD PRIMARY KEY (`user_id`,`category_id`),
  ADD KEY `category_id` (`category_id`);

--
-- Indexes for table `user_reel_likes`
--
ALTER TABLE `user_reel_likes`
  ADD PRIMARY KEY (`user_id`,`reel_id`),
  ADD KEY `reel_id` (`reel_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `categories`
--
ALTER TABLE `categories`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;

--
-- AUTO_INCREMENT for table `reels`
--
ALTER TABLE `reels`
  MODIFY `reel_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=46;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `reels`
--
ALTER TABLE `reels`
  ADD CONSTRAINT `reels_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `user_categories`
--
ALTER TABLE `user_categories`
  ADD CONSTRAINT `user_categories_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `user_categories_ibfk_2` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`);

--
-- Constraints for table `user_reel_likes`
--
ALTER TABLE `user_reel_likes`
  ADD CONSTRAINT `user_reel_likes_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `user_reel_likes_ibfk_2` FOREIGN KEY (`reel_id`) REFERENCES `reels` (`reel_id`) ON DELETE CASCADE;
COMMIT;

