--
-- Host: localhost    Database: media_sphere
-- ------------------------------------------------------


--
-- Table structure for table `attribute_terms`
--

CREATE TABLE `attribute_terms` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `attribute_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `value` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `attribute_terms_attribute_id_foreign` (`attribute_id`),
  CONSTRAINT `attribute_terms_attribute_id_foreign` FOREIGN KEY (`attribute_id`) REFERENCES `attributes` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `attribute_terms`
--


--
-- Table structure for table `attributes`
--

CREATE TABLE `attributes` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `attributes_slug_unique` (`slug`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `attributes`
--


--
-- Table structure for table `brands`
--

CREATE TABLE `brands` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `image` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `brands_slug_unique` (`slug`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `brands`
--

INSERT INTO `brands` VALUES (1,'Canon','canon',NULL,NULL,1,'2026-08-18 17:35:35','2026-08-18 17:35:35'),(2,'Nikon','nikon',NULL,NULL,1,'2026-08-18 17:35:35','2026-08-18 17:35:35'),(3,'Sony','sony',NULL,NULL,1,'2026-08-18 17:35:35','2026-08-18 17:35:35'),(4,'Godox','godox',NULL,NULL,1,'2026-08-18 17:35:35','2026-08-18 17:35:35'),(5,'Zoom','zoom',NULL,NULL,1,'2026-08-18 17:35:35','2026-08-18 17:35:35'),(6,'Insta360','insta360',NULL,NULL,1,'2026-08-18 17:35:35','2026-08-18 17:35:35'),(7,'Zhiyun','zhiyun',NULL,NULL,1,'2026-08-18 17:35:35','2026-08-18 17:35:35'),(8,'K&F','kf',NULL,NULL,1,'2026-08-18 17:35:35','2026-08-18 17:35:35'),(9,'Viltrox','viltrox',NULL,NULL,1,'2026-08-18 17:35:35','2026-08-18 17:35:35'),(10,'GoPro','gopro',NULL,NULL,1,'2026-08-18 17:35:35','2026-08-18 17:35:35'),(11,'Rokinon','rokinon',NULL,NULL,1,'2026-08-18 17:35:35','2026-08-18 17:35:35'),(12,'Rolux','rolux',NULL,NULL,1,'2026-08-18 17:35:35','2026-08-18 17:35:35'),(13,'Feelworld','feelworld',NULL,NULL,1,'2026-08-18 17:35:35','2026-08-18 17:35:35'),(14,'Samyang','samyang',NULL,NULL,1,'2026-08-18 17:35:35','2026-08-18 17:35:35'),(15,'Comica','comica',NULL,NULL,1,'2026-08-18 17:35:35','2026-08-18 17:35:35'),(16,'DJI','dji',NULL,NULL,1,'2026-08-18 17:35:35','2026-08-18 17:35:35'),(17,'Rode','rode',NULL,NULL,1,'2026-08-18 17:35:35','2026-08-18 17:35:35'),(18,'Tascam','tascam',NULL,NULL,1,'2026-08-18 17:35:35','2026-08-18 17:35:35'),(19,'Boya','boya',NULL,NULL,1,'2026-08-18 17:35:35','2026-08-18 17:35:35'),(20,'Fujifilm','fujifilm',NULL,NULL,1,'2026-08-18 17:35:35','2026-08-18 17:35:35');

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

CREATE TABLE `categories` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `parent_id` bigint(20) unsigned DEFAULT NULL,
  `image` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `order` int(11) NOT NULL DEFAULT 0,
  `views` bigint(20) unsigned NOT NULL DEFAULT 0,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `categories_slug_unique` (`slug`),
  KEY `categories_parent_id_foreign` (`parent_id`),
  CONSTRAINT `categories_parent_id_foreign` FOREIGN KEY (`parent_id`) REFERENCES `categories` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `categories` VALUES (1,'Photography','photography',NULL,NULL,NULL,1,190,1,'2026-08-18 17:35:35','2026-08-26 10:48:47'),(2,'Lighting','lighting',NULL,NULL,NULL,2,147,1,'2026-08-18 17:35:35','2026-08-26 10:40:21'),(3,'Pro Video','pro-video',NULL,NULL,NULL,3,124,1,'2026-08-18 17:35:35','2026-08-25 20:53:35'),(4,'Drones','drones',NULL,NULL,NULL,4,111,1,'2026-08-18 17:35:35','2026-08-24 13:54:10'),(5,'Pro Audio','pro-audio',NULL,NULL,NULL,5,81,1,'2026-08-18 17:35:35','2026-08-24 12:05:04'),(6,'Camcorders','camcorders',NULL,NULL,NULL,6,63,1,'2026-08-18 17:35:35','2026-08-24 13:36:17'),(8,'Camera Lenses','camera-lenses',1,NULL,NULL,1,15,1,'2026-08-19 14:48:10','2026-08-26 10:48:57'),(9,'Prime Lenses','prime-lenses',8,NULL,NULL,1,5,1,'2026-08-19 14:51:55','2026-08-26 10:49:06');

--
-- Table structure for table `category_product`
--

CREATE TABLE `category_product` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `category_id` bigint(20) unsigned NOT NULL,
  `product_id` bigint(20) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `category_product_category_id_product_id_unique` (`category_id`,`product_id`),
  KEY `category_product_product_id_foreign` (`product_id`),
  CONSTRAINT `category_product_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE,
  CONSTRAINT `category_product_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `category_product`
--

INSERT INTO `category_product` VALUES (2,1,3),(3,1,4),(4,1,5),(5,1,6),(6,2,7),(7,2,8),(8,2,9),(9,2,10),(10,3,11),(11,3,12),(12,3,13),(13,3,14),(14,4,15),(15,4,16),(16,4,17),(17,5,18),(18,5,19),(19,5,20),(20,5,21),(21,6,22),(22,6,23),(23,6,24),(25,8,3),(26,8,4),(27,8,5),(28,8,6),(29,8,7);

--
-- Table structure for table `compare_lists`
--

CREATE TABLE `compare_lists` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) unsigned NOT NULL,
  `product_id` bigint(20) unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `compare_lists_user_id_product_id_unique` (`user_id`,`product_id`),
  KEY `compare_lists_product_id_foreign` (`product_id`),
  CONSTRAINT `compare_lists_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE,
  CONSTRAINT `compare_lists_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `compare_lists`
--


--
-- Table structure for table `contact_messages`
--

CREATE TABLE `contact_messages` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `subject` varchar(255) DEFAULT NULL,
  `message` text NOT NULL,
  `admin_reply` text DEFAULT NULL,
  `replied_at` timestamp NULL DEFAULT NULL,
  `is_read` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `contact_messages`
--

INSERT INTO `contact_messages` VALUES (3,'CHIBUIKE OGODO','ogodochibuike@gmail.com','Urgent Camera','This is a new message to understand what happened','Hello 2, Thank you for your response, Our team will link up with you soon 2','2026-08-21 10:25:35',1,'2026-08-21 10:22:22','2026-08-21 10:25:35');

--
-- Table structure for table `coupons`
--

CREATE TABLE `coupons` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `code` varchar(255) NOT NULL,
  `type` enum('percent','fixed') NOT NULL DEFAULT 'percent',
  `value` decimal(12,2) NOT NULL DEFAULT 0.00,
  `min_spend` decimal(12,2) DEFAULT NULL,
  `expires_at` date DEFAULT NULL,
  `usage_limit` int(11) DEFAULT NULL,
  `used` int(11) NOT NULL DEFAULT 0,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `coupons_code_unique` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `coupons`
--

INSERT INTO `coupons` VALUES (1,'CHIBUIKE','percent',35.00,1000000.00,'2026-08-23',3,0,1,'2026-08-20 22:15:59','2026-08-20 22:17:21'),(2,'emma','percent',5.00,1000000.00,'2026-08-29',5,0,1,'2026-08-23 04:42:13','2026-08-23 04:42:13');

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

CREATE TABLE `failed_jobs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) NOT NULL,
  `connection` text NOT NULL,
  `queue` text NOT NULL,
  `payload` longtext NOT NULL,
  `exception` longtext NOT NULL,
  `failed_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `failed_jobs`
--


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

CREATE TABLE `migrations` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(255) NOT NULL,
  `batch` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `migrations` 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,'2026_08_18_000001_add_role_to_users_table',1),(6,'2026_08_18_000010_create_brands_table',1),(7,'2026_08_18_000020_create_categories_table',1),(8,'2026_08_18_000030_create_tags_table',1),(9,'2026_08_18_000040_create_attributes_tables',1),(10,'2026_08_18_000050_create_products_table',1),(11,'2026_08_18_000060_create_product_variations_table',1),(12,'2026_08_18_000070_create_product_reviews_table',1),(13,'2026_08_18_000080_create_coupons_table',1),(14,'2026_08_18_000090_create_orders_table',1),(15,'2026_08_18_000100_create_stock_movements_table',1),(16,'2026_08_18_000110_create_wishlists_and_compare_tables',1),(17,'2026_08_18_000120_create_vendors_tables',1),(18,'2026_08_18_000130_create_sliders_table',1),(19,'2026_08_18_000140_create_subscribers_and_contact_tables',1),(20,'2026_08_18_000150_create_pages_and_settings_tables',1),(21,'2026_08_19_000001_add_views_to_categories_table',2),(22,'2026_08_20_000100_add_payment_reference_to_orders_table',3),(23,'2026_08_21_000100_add_admin_reply_to_contact_messages_table',4),(24,'2026_08_21_000200_add_bank_transfer_fields_to_orders_table',5),(25,'2026_08_21_000300_add_order_key_to_orders_table',6);

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

CREATE TABLE `order_items` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `order_id` bigint(20) unsigned NOT NULL,
  `product_id` bigint(20) unsigned DEFAULT NULL,
  `variation_id` bigint(20) unsigned DEFAULT NULL,
  `vendor_id` bigint(20) unsigned DEFAULT NULL,
  `product_name` varchar(255) NOT NULL,
  `variation_name` varchar(255) DEFAULT NULL,
  `sku` varchar(255) DEFAULT NULL,
  `unit_price` decimal(12,2) NOT NULL,
  `quantity` int(11) NOT NULL,
  `line_total` decimal(12,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `order_items_order_id_foreign` (`order_id`),
  KEY `order_items_product_id_foreign` (`product_id`),
  KEY `order_items_variation_id_foreign` (`variation_id`),
  KEY `order_items_vendor_id_foreign` (`vendor_id`),
  CONSTRAINT `order_items_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE,
  CONSTRAINT `order_items_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE SET NULL,
  CONSTRAINT `order_items_variation_id_foreign` FOREIGN KEY (`variation_id`) REFERENCES `product_variations` (`id`) ON DELETE SET NULL,
  CONSTRAINT `order_items_vendor_id_foreign` FOREIGN KEY (`vendor_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=62 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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


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

CREATE TABLE `orders` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `order_number` varchar(255) NOT NULL,
  `order_key` varchar(255) DEFAULT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `customer_name` varchar(255) NOT NULL,
  `customer_email` varchar(255) NOT NULL,
  `customer_phone` varchar(255) DEFAULT NULL,
  `billing_address` varchar(255) DEFAULT NULL,
  `billing_city` varchar(255) DEFAULT NULL,
  `billing_state` varchar(255) DEFAULT NULL,
  `billing_country` varchar(255) DEFAULT NULL,
  `billing_zip` varchar(255) DEFAULT NULL,
  `shipping_address` varchar(255) DEFAULT NULL,
  `shipping_city` varchar(255) DEFAULT NULL,
  `shipping_state` varchar(255) DEFAULT NULL,
  `shipping_country` varchar(255) DEFAULT NULL,
  `shipping_zip` varchar(255) DEFAULT NULL,
  `subtotal` decimal(12,2) NOT NULL DEFAULT 0.00,
  `shipping` decimal(12,2) NOT NULL DEFAULT 0.00,
  `discount` decimal(12,2) NOT NULL DEFAULT 0.00,
  `coupon_code` varchar(255) DEFAULT NULL,
  `total` decimal(12,2) NOT NULL DEFAULT 0.00,
  `status` enum('pending','processing','completed','cancelled','refunded') NOT NULL DEFAULT 'pending',
  `payment_method` varchar(255) DEFAULT NULL,
  `payment_reference` varchar(255) DEFAULT NULL,
  `payment_deadline` timestamp NULL DEFAULT NULL,
  `payment_receipt` varchar(255) DEFAULT NULL,
  `payment_status` enum('unpaid','paid','awaiting_confirmation') NOT NULL DEFAULT 'unpaid',
  `tracking_number` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `orders_order_number_unique` (`order_number`),
  KEY `orders_user_id_foreign` (`user_id`),
  CONSTRAINT `orders_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=60 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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


--
-- Table structure for table `pages`
--

CREATE TABLE `pages` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `body` longtext DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `pages_slug_unique` (`slug`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `pages`
--

INSERT INTO `pages` VALUES (1,'About Us','about-us','<p>Media Sphere Limited is your trusted local camera store in Lagos, Nigeria, for original cameras, cinema cameras, drones, lighting equipment, computers, camcorders, and professional accessories.</p>','2026-08-18 17:35:35','2026-08-20 22:21:26'),(2,'FAQs','faqs','<p>Frequently asked questions about ordering, delivery and returns.</p>','2026-08-18 17:35:35','2026-08-18 17:35:35'),(3,'Features','features','<p>Discover the features of shopping with Media Sphere Limited.</p>','2026-08-18 17:35:35','2026-08-18 17:35:35'),(4,'Privacy Policy','privacy-policy','<p>How we collect, use and protect your personal information.</p>','2026-08-18 17:35:35','2026-08-18 17:35:35'),(5,'Terms & Conditions','terms-of-use','<p>The terms and conditions governing use of this store.</p>','2026-08-18 17:35:35','2026-08-18 17:35:35'),(6,'Refund & Return Policy','refund_returns','<p>Our refund and return policy for purchases.</p>','2026-08-18 17:35:35','2026-08-18 17:35:35');

--
-- Table structure for table `product_attribute`
--

CREATE TABLE `product_attribute` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `product_id` bigint(20) unsigned NOT NULL,
  `attribute_id` bigint(20) unsigned NOT NULL,
  `attribute_term_id` bigint(20) unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `product_attribute_product_id_foreign` (`product_id`),
  KEY `product_attribute_attribute_id_foreign` (`attribute_id`),
  KEY `product_attribute_attribute_term_id_foreign` (`attribute_term_id`),
  CONSTRAINT `product_attribute_attribute_id_foreign` FOREIGN KEY (`attribute_id`) REFERENCES `attributes` (`id`) ON DELETE CASCADE,
  CONSTRAINT `product_attribute_attribute_term_id_foreign` FOREIGN KEY (`attribute_term_id`) REFERENCES `attribute_terms` (`id`) ON DELETE CASCADE,
  CONSTRAINT `product_attribute_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `product_attribute`
--


--
-- Table structure for table `product_reviews`
--

CREATE TABLE `product_reviews` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `product_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `author_name` varchar(255) NOT NULL,
  `author_email` varchar(255) NOT NULL,
  `rating` tinyint(3) unsigned NOT NULL DEFAULT 5,
  `comment` text DEFAULT NULL,
  `is_approved` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `product_reviews_product_id_foreign` (`product_id`),
  KEY `product_reviews_user_id_foreign` (`user_id`),
  CONSTRAINT `product_reviews_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE,
  CONSTRAINT `product_reviews_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `product_reviews`
--

INSERT INTO `product_reviews` VALUES (1,3,NULL,'Ada Obi','ada@example.com',5,'Excellent camera.',1,'2026-08-24 13:39:08','2026-08-24 13:39:08'),(2,16,1,'Media Sphere Admin','admin@mediasphere.test',4,NULL,1,'2026-08-24 13:42:13','2026-08-24 13:42:13');

--
-- Table structure for table `product_tag`
--

CREATE TABLE `product_tag` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tag_id` bigint(20) unsigned NOT NULL,
  `product_id` bigint(20) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `product_tag_tag_id_product_id_unique` (`tag_id`,`product_id`),
  KEY `product_tag_product_id_foreign` (`product_id`),
  CONSTRAINT `product_tag_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE,
  CONSTRAINT `product_tag_tag_id_foreign` FOREIGN KEY (`tag_id`) REFERENCES `tags` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `product_tag`
--


--
-- Table structure for table `product_variations`
--

CREATE TABLE `product_variations` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `product_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `sku` varchar(255) DEFAULT NULL,
  `price` decimal(12,2) DEFAULT NULL,
  `sale_price` decimal(12,2) DEFAULT NULL,
  `stock_quantity` int(11) NOT NULL DEFAULT 0,
  `image` varchar(255) DEFAULT NULL,
  `attributes` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`attributes`)),
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `product_variations_product_id_foreign` (`product_id`),
  CONSTRAINT `product_variations_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `product_variations`
--


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

CREATE TABLE `products` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `sku` varchar(255) DEFAULT NULL,
  `type` enum('simple','variable') NOT NULL DEFAULT 'simple',
  `short_description` text DEFAULT NULL,
  `description` longtext DEFAULT NULL,
  `price` decimal(12,2) NOT NULL DEFAULT 0.00,
  `sale_price` decimal(12,2) DEFAULT NULL,
  `sale_end` date DEFAULT NULL,
  `stock_quantity` int(11) NOT NULL DEFAULT 0,
  `low_stock_threshold` int(11) NOT NULL DEFAULT 5,
  `status` enum('draft','published','hidden') NOT NULL DEFAULT 'published',
  `is_featured` tinyint(1) NOT NULL DEFAULT 0,
  `is_flash_sale` tinyint(1) NOT NULL DEFAULT 0,
  `manage_stock` tinyint(1) NOT NULL DEFAULT 1,
  `image` varchar(255) DEFAULT NULL,
  `gallery` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`gallery`)),
  `brand_id` bigint(20) unsigned DEFAULT NULL,
  `vendor_id` bigint(20) unsigned DEFAULT NULL,
  `average_rating` decimal(3,2) NOT NULL DEFAULT 0.00,
  `rating_count` int(11) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `products_slug_unique` (`slug`),
  KEY `products_brand_id_foreign` (`brand_id`),
  KEY `products_vendor_id_foreign` (`vendor_id`),
  CONSTRAINT `products_brand_id_foreign` FOREIGN KEY (`brand_id`) REFERENCES `brands` (`id`) ON DELETE SET NULL,
  CONSTRAINT `products_vendor_id_foreign` FOREIGN KEY (`vendor_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=80 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `products` VALUES (3,'Sony A7 IV Full-Frame Camera','sony-a7-iv-full-frame-camera','DEMO-0002','simple','Sample product — Sony equipment available at Media Sphere Limited.','This is a demo product so the storefront can be viewed while the administrator adds the real inventory. You can edit or delete this item from the admin panel.',2100000.00,NULL,NULL,22,5,'published',1,0,1,NULL,NULL,NULL,NULL,5.00,2,'2026-08-19 14:25:14','2026-08-24 13:45:54'),(4,'Nikon Z8 Mirrorless Camera','nikon-z8-mirrorless-camera','DEMO-0003','simple','Sample product — Nikon equipment available at Media Sphere Limited.','This is a demo product so the storefront can be viewed while the administrator adds the real inventory. You can edit or delete this item from the admin panel.',3250000.00,NULL,NULL,6,5,'published',1,0,1,NULL,NULL,NULL,NULL,4.50,1,'2026-08-19 14:25:14','2026-08-19 20:30:45'),(5,'Canon EF 50mm f/1.8 STM Lens','canon-ef-50mm-f18-stm-lens','DEMO-0004','simple','Sample product — Canon equipment available at Media Sphere Limited.','This is a demo product so the storefront can be viewed while the administrator adds the real inventory. You can edit or delete this item from the admin panel.',285000.00,NULL,NULL,25,5,'published',1,0,1,NULL,NULL,NULL,NULL,4.50,6,'2026-08-19 14:25:14','2026-08-24 15:14:47'),(6,'Sony FE 24-70mm f/2.8 GM II Lens','sony-fe-24-70mm-f28-gm-ii-lens','DEMO-0005','simple','Sample product — Sony equipment available at Media Sphere Limited.','This is a demo product so the storefront can be viewed while the administrator adds the real inventory. You can edit or delete this item from the admin panel.',1450000.00,NULL,NULL,19,5,'published',1,0,1,NULL,NULL,NULL,NULL,4.50,4,'2026-08-19 14:25:14','2026-08-19 14:25:14'),(7,'Godox SL60W LED Video Light','godox-sl60w-led-video-light','DEMO-0006','simple','Sample product — Godox equipment available at Media Sphere Limited.','This is a demo product so the storefront can be viewed while the administrator adds the real inventory. You can edit or delete this item from the admin panel.',145000.00,129000.00,NULL,19,5,'published',1,0,1,NULL,NULL,NULL,NULL,4.50,7,'2026-08-19 14:25:14','2026-08-19 15:45:58'),(8,'Aputure Amaran 100d LED Light','aputure-amaran-100d-led-light','DEMO-0007','simple','Sample product — Aputure equipment available at Media Sphere Limited.','This is a demo product so the storefront can be viewed while the administrator adds the real inventory. You can edit or delete this item from the admin panel.',220000.00,NULL,NULL,4,5,'published',0,0,1,NULL,NULL,NULL,NULL,4.50,4,'2026-08-19 14:25:14','2026-08-25 20:39:28'),(9,'Godox Softbox 90cm','godox-softbox-90cm','DEMO-0008','simple','Sample product — Godox equipment available at Media Sphere Limited.','This is a demo product so the storefront can be viewed while the administrator adds the real inventory. You can edit or delete this item from the admin panel.',65000.00,NULL,NULL,29,5,'published',0,0,1,NULL,NULL,NULL,NULL,4.50,3,'2026-08-19 14:25:14','2026-08-19 14:25:14'),(10,'Neewer Ring Light 18 inch','neewer-ring-light-18-inch','DEMO-0009','simple','Sample product — Neewer equipment available at Media Sphere Limited.','This is a demo product so the storefront can be viewed while the administrator adds the real inventory. You can edit or delete this item from the admin panel.',85000.00,NULL,NULL,27,5,'published',0,0,1,NULL,NULL,NULL,NULL,4.50,3,'2026-08-19 14:25:14','2026-08-19 14:25:14'),(11,'DJI RS 4 Pro Gimbal Stabilizer','dji-rs-4-pro-gimbal-stabilizer','DEMO-0010','simple','Sample product — DJI equipment available at Media Sphere Limited.','This is a demo product so the storefront can be viewed while the administrator adds the real inventory. You can edit or delete this item from the admin panel.',1450000.00,NULL,NULL,28,5,'published',0,0,1,NULL,NULL,NULL,NULL,4.50,8,'2026-08-19 14:25:14','2026-08-19 14:25:14'),(12,'Blackmagic Pocket Cinema Camera 6K','blackmagic-pocket-cinema-camera-6k','DEMO-0011','simple','Sample product — Blackmagic equipment available at Media Sphere Limited.','This is a demo product so the storefront can be viewed while the administrator adds the real inventory. You can edit or delete this item from the admin panel.',2650000.00,NULL,NULL,27,5,'published',0,0,1,NULL,NULL,NULL,NULL,4.50,6,'2026-08-19 14:25:14','2026-08-25 20:53:51'),(13,'Atomos Ninja V Monitor Recorder','atomos-ninja-v-monitor-recorder','DEMO-0012','simple','Sample product — Atomos equipment available at Media Sphere Limited.','This is a demo product so the storefront can be viewed while the administrator adds the real inventory. You can edit or delete this item from the admin panel.',680000.00,NULL,NULL,13,5,'published',0,0,1,NULL,NULL,NULL,NULL,4.50,1,'2026-08-19 14:25:14','2026-08-25 20:11:31'),(14,'Hollyland Solidcom C1 Pro Intercom','hollyland-solidcom-c1-pro-intercom','DEMO-0013','simple','Sample product — Hollyland equipment available at Media Sphere Limited.','This is a demo product so the storefront can be viewed while the administrator adds the real inventory. You can edit or delete this item from the admin panel.',385000.00,NULL,NULL,24,5,'published',0,0,1,'products/JQ3aPAYlyv32RwG7cILI8Pxn4r1FAyaIbbBAzkGx.jpg',NULL,NULL,NULL,4.50,4,'2026-08-19 14:25:14','2026-08-24 13:37:55'),(15,'DJI Mini 4 Pro Drone','dji-mini-4-pro-drone','DEMO-0014','simple','Sample product — DJI equipment available at Media Sphere Limited.','This is a demo product so the storefront can be viewed while the administrator adds the real inventory. You can edit or delete this item from the admin panel.',1250000.00,1140000.00,NULL,15,5,'published',0,0,1,NULL,NULL,NULL,NULL,4.50,3,'2026-08-19 14:25:14','2026-08-21 12:27:58'),(16,'DJI Air 3 Drone with Fly More','dji-air-3-drone-with-fly-more','DEMO-0015','simple','Sample product — DJI equipment available at Media Sphere Limited.','This is a demo product so the storefront can be viewed while the administrator adds the real inventory. You can edit or delete this item from the admin panel.',1900000.00,NULL,NULL,9,5,'published',0,0,1,NULL,NULL,NULL,NULL,4.00,1,'2026-08-19 14:25:14','2026-08-25 20:34:00'),(17,'Autel Robotics EVO Lite+ Drone','autel-robotics-evo-lite-drone','DEMO-0016','simple','Sample product — Autel equipment available at Media Sphere Limited.','This is a demo product so the storefront can be viewed while the administrator adds the real inventory. You can edit or delete this item from the admin panel.',1350000.00,NULL,NULL,27,5,'published',0,0,1,NULL,NULL,NULL,NULL,4.50,4,'2026-08-19 14:25:14','2026-08-19 14:25:14'),(18,'Zoom H6 Handy Recorder','zoom-h6-handy-recorder','DEMO-0017','simple','Sample product — Zoom equipment available at Media Sphere Limited.','This is a demo product so the storefront can be viewed while the administrator adds the real inventory. You can edit or delete this item from the admin panel.',420000.00,NULL,NULL,11,5,'published',0,0,1,NULL,NULL,NULL,NULL,4.50,2,'2026-08-19 14:25:14','2026-08-19 14:25:14'),(19,'Rode Wireless GO II Microphone','rode-wireless-go-ii-microphone','DEMO-0018','simple','Sample product — Rode equipment available at Media Sphere Limited.','This is a demo product so the storefront can be viewed while the administrator adds the real inventory. You can edit or delete this item from the admin panel.',265000.00,NULL,NULL,21,5,'published',0,0,1,NULL,NULL,NULL,NULL,4.50,8,'2026-08-19 14:25:14','2026-08-19 14:25:14'),(20,'DJI Mic 2 Wireless Microphone','dji-mic-2-wireless-microphone','DEMO-0019','simple','Sample product — DJI equipment available at Media Sphere Limited.','This is a demo product so the storefront can be viewed while the administrator adds the real inventory. You can edit or delete this item from the admin panel.',220000.00,NULL,NULL,30,5,'published',0,0,1,NULL,NULL,NULL,NULL,4.50,3,'2026-08-19 14:25:14','2026-08-19 14:25:14'),(21,'Shure SM7B Microphone','shure-sm7b-microphone','DEMO-0020','simple','Sample product — Shure equipment available at Media Sphere Limited.','This is a demo product so the storefront can be viewed while the administrator adds the real inventory. You can edit or delete this item from the admin panel.',480000.00,NULL,NULL,3,5,'published',0,0,1,NULL,NULL,NULL,NULL,4.50,3,'2026-08-19 14:25:14','2026-08-19 15:45:58'),(22,'Sony FDR-AX700 4K Camcorder','sony-fdr-ax700-4k-camcorder','DEMO-0021','simple','Sample product — Sony equipment available at Media Sphere Limited.','This is a demo product so the storefront can be viewed while the administrator adds the real inventory. You can edit or delete this item from the admin panel.',1680000.00,NULL,NULL,9,5,'published',0,0,1,NULL,NULL,NULL,NULL,4.50,4,'2026-08-19 14:25:14','2026-08-26 10:28:15'),(23,'Canon XA60 Professional Camcorder','canon-xa60-professional-camcorder','DEMO-0022','simple','Sample product — Canon equipment available at Media Sphere Limited.','This is a demo product so the storefront can be viewed while the administrator adds the real inventory. You can edit or delete this item from the admin panel.',1950000.00,NULL,NULL,28,5,'published',0,0,1,NULL,NULL,NULL,NULL,4.50,3,'2026-08-19 14:25:14','2026-08-19 14:25:14'),(24,'Insta360 GO 3S Action Camera','insta360-go-3s-action-camera','DEMO-0023','simple','Sample product — Insta360 equipment available at Media Sphere Limited.','This is a demo product so the storefront can be viewed while the administrator adds the real inventory. You can edit or delete this item from the admin panel.',310000.00,NULL,NULL,18,5,'published',0,0,1,NULL,NULL,NULL,NULL,4.50,6,'2026-08-19 14:25:14','2026-08-19 14:25:14');

--
-- Table structure for table `sliders`
--

CREATE TABLE `sliders` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(255) DEFAULT NULL,
  `subtitle` varchar(255) DEFAULT NULL,
  `button_text` varchar(255) DEFAULT NULL,
  `button_link` varchar(255) DEFAULT NULL,
  `image` varchar(255) NOT NULL,
  `position` enum('home','home_1','home_3','home_4') NOT NULL DEFAULT 'home',
  `order` int(11) NOT NULL DEFAULT 0,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sliders`
--


--
-- Table structure for table `stock_movements`
--

CREATE TABLE `stock_movements` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `product_id` bigint(20) unsigned NOT NULL,
  `type` enum('in','out','adjustment') NOT NULL,
  `quantity` int(11) NOT NULL,
  `note` varchar(255) DEFAULT NULL,
  `order_id` bigint(20) unsigned DEFAULT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `stock_movements_product_id_foreign` (`product_id`),
  KEY `stock_movements_order_id_foreign` (`order_id`),
  KEY `stock_movements_user_id_foreign` (`user_id`),
  CONSTRAINT `stock_movements_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE SET NULL,
  CONSTRAINT `stock_movements_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE,
  CONSTRAINT `stock_movements_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=58 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `stock_movements`
--


--
-- Table structure for table `subscribers`
--

CREATE TABLE `subscribers` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `email` varchar(255) NOT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `subscribers_email_unique` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `subscribers`
--


--
-- Table structure for table `tags`
--

CREATE TABLE `tags` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `tags_slug_unique` (`slug`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tags`
--


--
-- Table structure for table `vendor_applications`
--

CREATE TABLE `vendor_applications` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) unsigned NOT NULL,
  `store_name` varchar(255) NOT NULL,
  `business_email` varchar(255) DEFAULT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `address` varchar(255) DEFAULT NULL,
  `message` text DEFAULT NULL,
  `status` enum('pending','approved','rejected') NOT NULL DEFAULT 'pending',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vendor_applications_user_id_foreign` (`user_id`),
  CONSTRAINT `vendor_applications_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `vendor_applications`
--


--
-- Table structure for table `vendor_payouts`
--

CREATE TABLE `vendor_payouts` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `vendor_id` bigint(20) unsigned NOT NULL,
  `amount` decimal(12,2) NOT NULL,
  `method` varchar(255) DEFAULT NULL,
  `status` enum('pending','paid','failed') NOT NULL DEFAULT 'pending',
  `reference` varchar(255) DEFAULT NULL,
  `note` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vendor_payouts_vendor_id_foreign` (`vendor_id`),
  CONSTRAINT `vendor_payouts_vendor_id_foreign` FOREIGN KEY (`vendor_id`) REFERENCES `vendors` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `vendor_payouts`
--


--
-- Table structure for table `vendors`
--

CREATE TABLE `vendors` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) unsigned NOT NULL,
  `store_name` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `banner` varchar(255) DEFAULT NULL,
  `logo` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `address` varchar(255) DEFAULT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `commission_rate` decimal(5,2) NOT NULL DEFAULT 10.00,
  `balance` decimal(12,2) NOT NULL DEFAULT 0.00,
  `status` enum('pending','approved','suspended','rejected') NOT NULL DEFAULT 'pending',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `vendors_slug_unique` (`slug`),
  KEY `vendors_user_id_foreign` (`user_id`),
  CONSTRAINT `vendors_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `vendors`
--


--
-- Table structure for table `wishlists`
--

CREATE TABLE `wishlists` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) unsigned NOT NULL,
  `product_id` bigint(20) unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `wishlists_user_id_product_id_unique` (`user_id`,`product_id`),
  KEY `wishlists_product_id_foreign` (`product_id`),
  CONSTRAINT `wishlists_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE,
  CONSTRAINT `wishlists_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `wishlists`
--


--
-- Dumping routines for database 'media_sphere'
--


