-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 12, 2026 at 07:43 AM
-- Server version: 10.4.32-MariaDB
-- 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: `shopnest_db`
--

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

--
-- Table structure for table `admin`
--

CREATE TABLE `admin` (
  `id` int(11) NOT NULL,
  `username` varchar(50) NOT NULL,
  `password` varchar(255) NOT NULL,
  `role` varchar(20) DEFAULT 'admin',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `admin`
--

INSERT INTO `admin` (`id`, `username`, `password`, `role`, `created_at`) VALUES
(1, 'admin', '$2y$10$mLnoJtPAggdlxvB6Di8P2ex5QKpaftMOlCwNKEamCeYy7yTYZjGma', 'admin', '2026-01-20 11:26:52');

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

--
-- Table structure for table `admin_notifications`
--

CREATE TABLE `admin_notifications` (
  `id` int(11) NOT NULL,
  `title` varchar(200) NOT NULL,
  `message` text NOT NULL,
  `type` varchar(50) DEFAULT NULL,
  `is_read` tinyint(1) DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `admin_notifications`
--

INSERT INTO `admin_notifications` (`id`, `title`, `message`, `type`, `is_read`, `created_at`) VALUES
(1, 'ID Proof Submission', 'New ID proof submitted by user ID: 1', 'verification', 0, '2026-01-22 07:00:06'),
(2, 'ID Proof Submission', 'New ID proof submitted by user ID: 1', 'verification', 0, '2026-01-22 07:01:02'),
(3, 'ID Verification System Ready', 'ID verification system has been successfully installed.', 'system', 0, '2026-01-22 10:20:40'),
(4, 'ID Verification System Ready', 'ID verification system has been successfully installed.', 'system', 0, '2026-01-22 11:34:59');

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

--
-- Table structure for table `admin_verification_logs`
--

CREATE TABLE `admin_verification_logs` (
  `id` int(11) NOT NULL,
  `proof_id` int(11) NOT NULL,
  `admin_id` int(11) NOT NULL,
  `action` enum('verified','rejected','pending') NOT NULL,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

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

CREATE TABLE `categories` (
  `id` int(11) NOT NULL,
  `category_name` varchar(100) NOT NULL,
  `description` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `status` enum('active','inactive') DEFAULT 'active'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `categories` (`id`, `category_name`, `description`, `created_at`, `status`) VALUES
(1, 'Traditional Wear', 'Ethnic and traditional clothing for all occasions', '2026-01-20 11:26:53', 'active'),
(2, 'Western Wear', 'Casual and formal western clothing', '2026-01-20 11:26:53', 'active'),
(3, 'Party Wear', 'Elegant dresses for parties and events', '2026-01-20 11:26:53', 'active'),
(4, 'Wedding Wear', 'Bridal and wedding guest outfits', '2026-01-20 11:26:53', 'active'),
(5, 'Casual Wear', 'Everyday comfortable clothing', '2026-01-20 11:26:53', 'active'),
(6, 'Designer Wear', 'Premium designer clothing collections', '2026-01-20 11:26:53', 'active'),
(7, 'Accessories', 'Jewelry, bags, and fashion accessories', '2026-01-20 11:26:53', 'active'),
(8, 'Kids Wear', 'Clothing for children', '2026-01-20 11:26:53', 'active');

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

--
-- Table structure for table `homepage_videos`
--

CREATE TABLE `homepage_videos` (
  `id` int(11) NOT NULL,
  `video_url` varchar(255) NOT NULL,
  `video_type` enum('youtube','vimeo','direct') DEFAULT 'youtube',
  `thumbnail_url` varchar(255) DEFAULT NULL,
  `title` varchar(200) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `display_order` int(11) DEFAULT 0,
  `is_active` tinyint(1) DEFAULT 1,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `orders`
--

CREATE TABLE `orders` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `total_price` decimal(10,2) NOT NULL,
  `status` varchar(50) DEFAULT 'Pending',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `shipping_address` text NOT NULL,
  `special_instructions` text DEFAULT NULL,
  `start_date` date DEFAULT NULL,
  `return_date` date DEFAULT NULL,
  `rental_days` int(11) DEFAULT 3,
  `end_date` date DEFAULT NULL,
  `payment_status` varchar(50) DEFAULT 'Pending',
  `payment_id` varchar(100) DEFAULT NULL,
  `id_verified` tinyint(1) DEFAULT 0,
  `id_proof_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `orders`
--

INSERT INTO `orders` (`id`, `user_id`, `total_price`, `status`, `created_at`, `shipping_address`, `special_instructions`, `start_date`, `return_date`, `rental_days`, `end_date`, `payment_status`, `payment_id`, `id_verified`, `id_proof_id`) VALUES
(5, 2, 451.82, 'Paid', '2026-01-31 09:33:53', 'qwertyuiqwertyuwertyuertyuiasdfghjasdfghjxcvbnmzxcv', '', '2026-01-31', '2026-02-03', 3, NULL, 'Pending', NULL, 0, NULL),
(6, 2, 863.64, 'Cancelled', '2026-01-31 09:35:47', 'qwertyuiqwertyuwertyuertyuiasdfghjasdfghjxcvbnmzxcv', '', '2026-01-31', '2026-02-03', 3, NULL, 'Pending', NULL, 0, NULL),
(7, 2, 630.00, 'Delivered', '2026-01-31 10:36:48', 'qwertyuiqwertyuwertyuertyuiasdfghjasdfghjxcvbnmzxcv', '', '2026-01-31', '2026-02-03', 3, NULL, 'Pending', NULL, 0, NULL),
(8, 2, 451.82, 'Pending', '2026-01-31 11:17:07', 'qwertyuiqwertyuwertyuertyuiasdfghjasdfghjxcvbnmzxcv', '', '2026-01-31', '2026-02-03', 3, NULL, 'Pending', NULL, 0, NULL);

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

--
-- Table structure for table `order_history`
--

CREATE TABLE `order_history` (
  `id` int(11) NOT NULL,
  `order_id` int(11) NOT NULL,
  `status` varchar(50) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `updated_by` varchar(100) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `order_history`
--

INSERT INTO `order_history` (`id`, `order_id`, `status`, `notes`, `updated_by`, `created_at`) VALUES
(5, 6, 'Cancelled', NULL, 'admin', '2026-01-31 09:37:15'),
(6, 6, 'Cancelled', NULL, 'admin', '2026-01-31 09:37:24'),
(7, 5, 'Paid', NULL, 'admin', '2026-01-31 09:37:33'),
(8, 7, 'Shipped', NULL, 'admin', '2026-01-31 10:43:06'),
(9, 7, 'Delivered', NULL, 'admin', '2026-01-31 10:43:13');

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

--
-- Table structure for table `order_items`
--

CREATE TABLE `order_items` (
  `id` int(11) NOT NULL,
  `order_id` int(11) NOT NULL,
  `product_id` int(11) NOT NULL,
  `product_name` varchar(200) NOT NULL,
  `price` decimal(10,2) NOT NULL,
  `quantity` int(11) DEFAULT 1,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `order_items`
--

INSERT INTO `order_items` (`id`, `order_id`, `product_id`, `product_name`, `price`, `quantity`, `created_at`) VALUES
(5, 5, 1, 'Red Silk Saree', 299.00, 1, '2026-01-31 09:33:53'),
(6, 6, 1, 'Red Silk Saree', 299.00, 1, '2026-01-31 09:35:47'),
(7, 6, 5, 'Cocktail Dress', 349.00, 1, '2026-01-31 09:35:47'),
(8, 7, 2, 'Designer Lehenga', 450.00, 1, '2026-01-31 10:36:48'),
(9, 8, 1, 'Red Silk Saree', 299.00, 1, '2026-01-31 11:17:07');

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

--
-- Table structure for table `password_resets`
--

CREATE TABLE `password_resets` (
  `id` int(11) NOT NULL,
  `email` varchar(100) NOT NULL,
  `token` varchar(100) NOT NULL,
  `expires_at` datetime NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `password_resets`
--

INSERT INTO `password_resets` (`id`, `email`, `token`, `expires_at`, `created_at`) VALUES
(8, 'itsabhishek421@gmail.com', '7f072e726638af6319f70435a45793e67c8f166dff471b007f51f9485aecb0984f39863761612cf810a81e63b3b78f19d3c0', '2026-02-02 15:19:19', '2026-02-02 13:19:19');

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

--
-- Table structure for table `products`
--

CREATE TABLE `products` (
  `id` int(11) NOT NULL,
  `name` varchar(200) NOT NULL,
  `description` text DEFAULT NULL,
  `price` decimal(10,2) NOT NULL,
  `category_id` int(11) DEFAULT NULL,
  `size` varchar(20) DEFAULT NULL,
  `color` varchar(50) DEFAULT NULL,
  `stock` int(11) DEFAULT 1,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `available` tinyint(1) DEFAULT 1,
  `brand` varchar(100) DEFAULT NULL,
  `product_condition` varchar(50) DEFAULT NULL,
  `material` varchar(100) DEFAULT NULL,
  `rental_days` int(11) DEFAULT 7,
  `deposit_amount` decimal(10,2) DEFAULT 0.00,
  `featured` tinyint(1) DEFAULT 0,
  `sku` varchar(100) DEFAULT NULL,
  `status` enum('active','inactive','out_of_stock') DEFAULT 'active',
  `min_stock` int(11) DEFAULT 5,
  `discount_percent` int(11) DEFAULT 0,
  `original_price` decimal(10,2) DEFAULT 0.00,
  `slug` varchar(255) DEFAULT NULL,
  `security_deposit` decimal(10,2) DEFAULT 0.00,
  `images` varchar(255) NOT NULL,
  `rental_price` decimal(10,2) DEFAULT 0.00
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `products`
--

INSERT INTO `products` (`id`, `name`, `description`, `price`, `category_id`, `size`, `color`, `stock`, `created_at`, `available`, `brand`, `product_condition`, `material`, `rental_days`, `deposit_amount`, `featured`, `sku`, `status`, `min_stock`, `discount_percent`, `original_price`, `slug`, `security_deposit`, `images`, `rental_price`) VALUES
(1, 'Red Silk Saree', 'Beautiful traditional red silk saree with zari work', 299.00, 1, 'Free Size', 'Red', 2, '2026-01-20 11:26:53', 1, NULL, NULL, NULL, 7, 0.00, 0, NULL, 'active', 5, 0, 0.00, NULL, 0.00, 'saree1.jpg', 0.00),
(2, 'Designer Lehenga', 'Heavy embroidered lehenga choli for special occasions', 450.00, 1, 'M', 'Gold', 2, '2026-01-20 11:26:53', 1, NULL, NULL, NULL, 7, 0.00, 0, NULL, 'active', 5, 0, 0.00, NULL, 0.00, 'lehenga1.jpg', 0.00),
(3, 'Evening Gown', 'Elegant black evening gown for formal events', 399.00, 2, 'L', 'Black', 1, '2026-01-20 11:26:53', 1, NULL, NULL, NULL, 7, 0.00, 0, NULL, 'active', 5, 0, 0.00, NULL, 0.00, 'gown1.jpg', 0.00),
(5, 'Cocktail Dress', 'Beautiful cocktail dress for parties', 349.00, 3, 'S', 'Navy Blue', 3, '2026-01-20 11:26:53', 1, NULL, NULL, NULL, 7, 0.00, 0, NULL, 'active', 5, 0, 0.00, NULL, 0.00, 'Cocktail Dress.webp', 0.00),
(6, 'Designer Anarkali', 'Printed Anarkali suit for festive occasions', 279.00, 1, 'M', 'Pink', 1, '2026-01-20 11:26:53', 1, NULL, NULL, NULL, 7, 0.00, 0, NULL, 'active', 5, 0, 0.00, NULL, 0.00, 'anarkali1.jpg', 0.00),
(10, 'gfcdc', 'xr gf fgcdrxrcred', 1000.00, 1, 'M', 'gfvftcfdc', 7, '2026-01-31 10:41:26', 1, 'rdrf', NULL, '', 3, 0.00, 1, NULL, 'active', 5, 20, 0.00, NULL, 2500.00, '1769856086_697ddc5665df5.png', 1500.00),
(11, 'tyvtgvtgvt', 'drxdcgfcf', 1600.00, 8, 'S', 'rtfrc', 7, '2026-01-31 13:25:56', 1, 'dfdcfc', NULL, 'cfv', 5, 0.00, 0, NULL, 'active', 5, 20, 0.00, NULL, 3500.00, '1769865956_697e02e4654a0.png', 2000.00);

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

--
-- Table structure for table `product_images`
--

CREATE TABLE `product_images` (
  `id` int(11) NOT NULL,
  `product_id` int(11) NOT NULL,
  `image` varchar(255) NOT NULL,
  `is_main` tinyint(1) DEFAULT 0,
  `images` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `reviews`
--

CREATE TABLE `reviews` (
  `id` int(11) NOT NULL,
  `product_id` int(11) NOT NULL,
  `user_id` int(11) DEFAULT NULL,
  `rating` tinyint(4) NOT NULL,
  `comment` text DEFAULT NULL,
  `status` enum('pending','approved','rejected') DEFAULT 'pending',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `settings`
--

CREATE TABLE `settings` (
  `id` int(11) NOT NULL,
  `setting_key` varchar(100) NOT NULL,
  `setting_value` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `settings`
--

INSERT INTO `settings` (`id`, `setting_key`, `setting_value`, `created_at`) VALUES
(1, 'site_name', 'shopnest', '2026-01-21 08:13:28'),
(2, 'site_email', 'admin@shopnest.com', '2026-01-21 08:13:28'),
(3, 'currency', '₹', '2026-01-21 08:13:28'),
(4, 'delivery_charge', '99', '2026-01-21 08:13:28'),
(5, 'tax_percentage', '18', '2026-01-21 08:13:28'),
(6, 'max_rental_days', '30', '2026-01-21 08:13:28'),
(7, 'min_rental_days', '1', '2026-01-21 08:13:28');

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

--
-- Table structure for table `testimonials`
--

CREATE TABLE `testimonials` (
  `id` int(11) NOT NULL,
  `customer_name` varchar(100) NOT NULL,
  `customer_image` varchar(255) DEFAULT NULL,
  `rating` int(11) DEFAULT 5,
  `review_text` text NOT NULL,
  `is_featured` tinyint(1) DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `email` varchar(100) NOT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `password` varchar(255) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `id_verified` tinyint(1) DEFAULT 0,
  `verification_level` enum('none','basic','full') DEFAULT 'none',
  `verification_date` timestamp NULL DEFAULT NULL,
  `verification_notes` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `users`
--

INSERT INTO `users` (`id`, `name`, `email`, `phone`, `address`, `password`, `created_at`, `id_verified`, `verification_level`, `verification_date`, `verification_notes`) VALUES
(2, 'Abhishek Mishra', 'itsabhishek421@gmail.com', '7633035450', 'qwertyuiqwertyuwertyuertyuiasdfghjasdfghjxcvbnmzxcv', '$2y$10$WGYeEqUxNT0SB7C2CvCuMOmCVX0vtNW.GpefaAOcWJS57g2FQ6P4W', '2026-01-22 07:53:32', 1, '', NULL, NULL),
(3, 'abhi', 'abc@gmail.com', '99999999999999', 'pratap vihar', '$2y$10$8qb1fy2AG/DZbq.9jbuv/eF15LAN63bmKVGdPNIpPlla88WKQE7YS', '2026-01-31 08:28:42', 0, 'none', NULL, NULL);

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

--
-- Table structure for table `user_id_proofs`
--

CREATE TABLE `user_id_proofs` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `proof_type` enum('aadhar','driving_license','passport','voter_id','pan_card') NOT NULL,
  `front_image` varchar(255) NOT NULL,
  `back_image` varchar(255) DEFAULT NULL,
  `proof_number` varchar(100) NOT NULL,
  `full_name` varchar(200) DEFAULT NULL,
  `date_of_birth` date DEFAULT NULL,
  `issue_date` date DEFAULT NULL,
  `expiry_date` date DEFAULT NULL,
  `address` text DEFAULT NULL,
  `verification_status` enum('pending','verified','rejected','expired') DEFAULT 'pending',
  `rejection_reason` text DEFAULT NULL,
  `verified_by` int(11) DEFAULT NULL,
  `verified_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `user_id_proofs`
--

INSERT INTO `user_id_proofs` (`id`, `user_id`, `proof_type`, `front_image`, `back_image`, `proof_number`, `full_name`, `date_of_birth`, `issue_date`, `expiry_date`, `address`, `verification_status`, `rejection_reason`, `verified_by`, `verified_at`, `created_at`, `updated_at`) VALUES
(3, 2, 'aadhar', 'front_1769170670_2.png', NULL, '687766378294', 'Abhishek Kumar Mishra', '2003-07-06', NULL, NULL, NULL, 'rejected', 'yuahuihuisfh', NULL, NULL, '2026-01-23 12:17:50', '2026-01-31 07:16:43'),
(4, 2, 'aadhar', 'front_1769850535_2.png', NULL, '687766378294', 'gggtvgbv', '0078-03-05', NULL, NULL, NULL, 'verified', NULL, NULL, '2026-01-31 09:09:01', '2026-01-31 09:08:55', '2026-01-31 09:09:01'),
(5, 2, 'aadhar', 'front_1769850591_2.png', NULL, '687766378294', 'gggtvgbv', '0078-03-05', NULL, NULL, NULL, 'verified', NULL, NULL, '2026-01-31 09:10:31', '2026-01-31 09:09:51', '2026-01-31 09:10:31'),
(6, 2, 'aadhar', 'front_1769850595_2.png', NULL, '687766378294', 'gggtvgbv', '0078-03-05', NULL, NULL, NULL, 'verified', NULL, NULL, '2026-01-31 09:10:33', '2026-01-31 09:09:55', '2026-01-31 09:10:33');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `admin`
--
ALTER TABLE `admin`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `username` (`username`);

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

--
-- Indexes for table `admin_verification_logs`
--
ALTER TABLE `admin_verification_logs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `proof_id` (`proof_id`),
  ADD KEY `admin_id` (`admin_id`);

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

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

--
-- Indexes for table `orders`
--
ALTER TABLE `orders`
  ADD PRIMARY KEY (`id`),
  ADD KEY `user_id` (`user_id`);

--
-- Indexes for table `order_history`
--
ALTER TABLE `order_history`
  ADD PRIMARY KEY (`id`),
  ADD KEY `order_id` (`order_id`);

--
-- Indexes for table `order_items`
--
ALTER TABLE `order_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `order_id` (`order_id`),
  ADD KEY `product_id` (`product_id`);

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

--
-- Indexes for table `products`
--
ALTER TABLE `products`
  ADD PRIMARY KEY (`id`),
  ADD KEY `category_id` (`category_id`);

--
-- Indexes for table `product_images`
--
ALTER TABLE `product_images`
  ADD PRIMARY KEY (`id`),
  ADD KEY `product_id` (`product_id`);

--
-- Indexes for table `reviews`
--
ALTER TABLE `reviews`
  ADD PRIMARY KEY (`id`),
  ADD KEY `product_id` (`product_id`);

--
-- Indexes for table `settings`
--
ALTER TABLE `settings`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `setting_key` (`setting_key`);

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

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `email` (`email`);

--
-- Indexes for table `user_id_proofs`
--
ALTER TABLE `user_id_proofs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_user` (`user_id`),
  ADD KEY `idx_status` (`verification_status`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `admin`
--
ALTER TABLE `admin`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `admin_notifications`
--
ALTER TABLE `admin_notifications`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `admin_verification_logs`
--
ALTER TABLE `admin_verification_logs`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `categories`
--
ALTER TABLE `categories`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;

--
-- AUTO_INCREMENT for table `homepage_videos`
--
ALTER TABLE `homepage_videos`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `orders`
--
ALTER TABLE `orders`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `order_history`
--
ALTER TABLE `order_history`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;

--
-- AUTO_INCREMENT for table `order_items`
--
ALTER TABLE `order_items`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;

--
-- AUTO_INCREMENT for table `password_resets`
--
ALTER TABLE `password_resets`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `products`
--
ALTER TABLE `products`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;

--
-- AUTO_INCREMENT for table `product_images`
--
ALTER TABLE `product_images`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `reviews`
--
ALTER TABLE `reviews`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `settings`
--
ALTER TABLE `settings`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `testimonials`
--
ALTER TABLE `testimonials`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `user_id_proofs`
--
ALTER TABLE `user_id_proofs`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `admin_verification_logs`
--
ALTER TABLE `admin_verification_logs`
  ADD CONSTRAINT `admin_verification_logs_ibfk_1` FOREIGN KEY (`proof_id`) REFERENCES `user_id_proofs` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `admin_verification_logs_ibfk_2` FOREIGN KEY (`admin_id`) REFERENCES `admin` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `orders`
--
ALTER TABLE `orders`
  ADD CONSTRAINT `orders_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `order_history`
--
ALTER TABLE `order_history`
  ADD CONSTRAINT `order_history_ibfk_1` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `order_items`
--
ALTER TABLE `order_items`
  ADD CONSTRAINT `order_items_ibfk_1` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `order_items_ibfk_2` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`);

--
-- Constraints for table `products`
--
ALTER TABLE `products`
  ADD CONSTRAINT `products_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`);

--
-- Constraints for table `product_images`
--
ALTER TABLE `product_images`
  ADD CONSTRAINT `product_images_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `reviews`
--
ALTER TABLE `reviews`
  ADD CONSTRAINT `reviews_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `user_id_proofs`
--
ALTER TABLE `user_id_proofs`
  ADD CONSTRAINT `user_id_proofs_ibfk_1` 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 */;
