text: -- phpMyAdmin SQL Dump
  -- version 4.8.2
  -- https://www.phpmyadmin.net/
  --
  -- Host: 127.0.0.1
  -- Generation Time: Sep 08, 2018 at 06:04 AM
  -- Server version: 5.7.21
  -- PHP Version: 7.2.7
  
  SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
  SET AUTOCOMMIT = 0;
  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: `shopping`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `carts`
  --
  
  CREATE TABLE `carts` (
    `id` int(11) NOT NULL,
    `total_price` int(11) DEFAULT NULL,
    `session_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `cart_items`
  --
  
  CREATE TABLE `cart_items` (
    `id` int(11) NOT NULL,
    `cart_id` int(11) NOT NULL,
    `quantity` int(11) NOT NULL,
    `product_id` int(11) NOT NULL,
    `is_wishlisted` tinyint(1) NOT NULL,
    `updated_at` datetime NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `products`
  --
  
  CREATE TABLE `products` (
    `id` int(11) NOT NULL,
    `product_type` int(11) DEFAULT NULL,
    `product_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
    `product_desc` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
    `price` int(11) NOT NULL,
    `image` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
    `quantity` int(11) NOT NULL,
    `sale_amount` int(11) DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `products_types`
  --
  
  CREATE TABLE `products_types` (
    `id` int(11) NOT NULL,
    `product_type` varchar(255) COLLATE utf8_unicode_ci NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  
  --
  -- Dumping data for table `products_types`
  --
  
  INSERT INTO `products_types` (`id`, `product_type`) VALUES
  (1, 'Normal'),
  (2, 'Sale');
  
  --
  -- Indexes for dumped tables
  --
  
  --
  -- Indexes for table `carts`
  --
  ALTER TABLE `carts`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `cart_items`
  --
  ALTER TABLE `cart_items`
    ADD PRIMARY KEY (`id`),
    ADD KEY `IDX_BEF484454584665A` (`product_id`),
    ADD KEY `cart_id_idx` (`cart_id`);
  
  --
  -- Indexes for table `products`
  --
  ALTER TABLE `products`
    ADD PRIMARY KEY (`id`),
    ADD KEY `IDX_B3BA5A5A1367588` (`product_type`);
  
  --
  -- Indexes for table `products_types`
  --
  ALTER TABLE `products_types`
    ADD PRIMARY KEY (`id`);
  
  --
  -- AUTO_INCREMENT for dumped tables
  --
  
  --
  -- AUTO_INCREMENT for table `carts`
  --
  ALTER TABLE `carts`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;
  
  --
  -- AUTO_INCREMENT for table `cart_items`
  --
  ALTER TABLE `cart_items`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=235;
  
  --
  -- AUTO_INCREMENT for table `products`
  --
  ALTER TABLE `products`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
  
  --
  -- AUTO_INCREMENT for table `products_types`
  --
  ALTER TABLE `products_types`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
  
  --
  -- Constraints for dumped tables
  --
  
  --
  -- Constraints for table `cart_items`
  --
  ALTER TABLE `cart_items`
    ADD CONSTRAINT `FK_BEF484451AD5CDBF` FOREIGN KEY (`cart_id`) REFERENCES `carts` (`id`) ON DELETE CASCADE,
    ADD CONSTRAINT `FK_BEF484454584665A` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE;
  
  --
  -- Constraints for table `products`
  --
  ALTER TABLE `products`
    ADD CONSTRAINT `FK_B3BA5A5A1367588` FOREIGN KEY (`product_type`) REFERENCES `products_types` (`id`);
  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 */;
  