text: -- phpMyAdmin SQL Dump
  -- version 5.1.0
  -- https://www.phpmyadmin.net/
  --
  -- Host: localhost
  -- Generation Time: Jun 05, 2021 at 03:15 PM
  -- Server version: 5.7.24
  -- PHP Version: 7.4.16
  
  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: `codeme`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `posts`
  --
  
  CREATE TABLE `posts` (
    `id` int(11) NOT NULL,
    `user_id` int(11) NOT NULL,
    `title` varchar(255) NOT NULL,
    `category` varchar(255) DEFAULT NULL,
    `body` text NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  
  --
  -- Dumping data for table `posts`
  --
  
  INSERT INTO `posts` (`id`, `user_id`, `title`, `category`, `body`, `created_at`, `updated_at`) VALUES
  (1, 2, 'Solve The Arithmatic Operation', NULL, '<p>How do it works?</p>\r\n<pre>int x = 5 : 4;</pre>', '2020-05-13 13:12:25', '2020-05-13 13:12:25'),
  (2, 1, 'Zahra Cantik', 'PHP', '<p>Ini gimana ko gabisaa..</p>\r\n<p><code>public static void main(String args[]) {</code></p>\r\n<p><code>&nbsp;&nbsp;&nbsp; Scanner s = new Scanner(System.in);</code></p>\r\n<p><code>&nbsp;&nbsp;&nbsp; String str = s.nextLine();</code></p>\r\n<p><code>}</code></p>', '2021-05-22 19:49:25', '2021-06-05 08:13:46');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `replies`
  --
  
  CREATE TABLE `replies` (
    `id` int(11) NOT NULL,
    `user_id` int(11) NOT NULL,
    `post_id` int(11) NOT NULL,
    `reply` text NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  
  --
  -- Dumping data for table `replies`
  --
  
  INSERT INTO `replies` (`id`, `user_id`, `post_id`, `reply`, `created_at`, `updated_at`) VALUES
  (15, 1, 1, '<p>You have to use slash to divide, then your code should be like this</p>\r\n<div><code>int x = 5 / 4;</code><br /><br />thank me later</div>', '2020-05-13 13:15:56', '2020-05-13 13:16:45'),
  (17, 1, 2, '<p>Ya gitu...</p>', '2021-05-22 19:49:40', '2021-05-22 19:49:40');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `users`
  --
  
  CREATE TABLE `users` (
    `id` int(11) NOT NULL,
    `name` varchar(255) NOT NULL,
    `email` varchar(255) NOT NULL,
    `password` varchar(255) NOT NULL,
    `role` int(11) NOT NULL DEFAULT '2'
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  
  --
  -- Dumping data for table `users`
  --
  
  INSERT INTO `users` (`id`, `name`, `email`, `password`, `role`) VALUES
  (1, 'Farhan', 'farhan@codeiva.com', '1ac5012170b65fb99f171ad799d045ac', 1),
  (2, 'Farhan 2', 'farhan2@codeiva.com', '1ac5012170b65fb99f171ad799d045ac', 2);
  
  --
  -- Indexes for dumped tables
  --
  
  --
  -- Indexes for table `posts`
  --
  ALTER TABLE `posts`
    ADD PRIMARY KEY (`id`),
    ADD KEY `posts_user_id_foreign` (`user_id`);
  
  --
  -- Indexes for table `replies`
  --
  ALTER TABLE `replies`
    ADD PRIMARY KEY (`id`),
    ADD KEY `comments_user_id_foreign` (`user_id`),
    ADD KEY `comments_article_id_foreign` (`post_id`);
  
  --
  -- Indexes for table `users`
  --
  ALTER TABLE `users`
    ADD PRIMARY KEY (`id`);
  
  --
  -- AUTO_INCREMENT for dumped tables
  --
  
  --
  -- AUTO_INCREMENT for table `posts`
  --
  ALTER TABLE `posts`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
  
  --
  -- AUTO_INCREMENT for table `replies`
  --
  ALTER TABLE `replies`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;
  
  --
  -- AUTO_INCREMENT for table `users`
  --
  ALTER TABLE `users`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
  
  --
  -- Constraints for dumped tables
  --
  
  --
  -- Constraints for table `posts`
  --
  ALTER TABLE `posts`
    ADD CONSTRAINT `posts_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
  
  --
  -- Constraints for table `replies`
  --
  ALTER TABLE `replies`
    ADD CONSTRAINT `comments_article_id_foreign` FOREIGN KEY (`post_id`) REFERENCES `posts` (`id`) ON DELETE CASCADE,
    ADD CONSTRAINT `comments_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `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 */;
  