

CREATE TABLE IF NOT EXISTS `cars` (
  `id` INT AUTO_INCREMENT PRIMARY KEY,
  `name` VARCHAR(200) NOT NULL,
  `category` VARCHAR(100) NOT NULL,
  `tag` VARCHAR(100) NOT NULL,
  `condition_type` VARCHAR(50) NOT NULL DEFAULT 'Brand New',
  `year` VARCHAR(10) NOT NULL,
  `fuel` VARCHAR(50) NOT NULL,
  `mileage` VARCHAR(50) NOT NULL DEFAULT '0 km',
  `image_url` VARCHAR(500) NOT NULL,
  `is_featured` TINYINT(1) NOT NULL DEFAULT 0,
  `sort_order` INT NOT NULL DEFAULT 0,
  `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  `updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

-- Seed sample cars from your existing FeaturedCars/Inventory data
INSERT INTO `cars` (`name`, `category`, `tag`, `condition_type`, `year`, `fuel`, `mileage`, `image_url`, `is_featured`, `sort_order`) VALUES
('BMW X5 xDrive', 'German Spec', 'SUV', 'Brand New', '2024', 'Petrol', '0 km', '/assets/car-suv.jpg', 1, 1),
('Porsche 911 Carrera', 'German Spec', 'Sports', 'Brand New', '2024', 'Petrol', '0 km', '/assets/car-sports.jpg', 1, 2),
('Toyota Land Cruiser V8', 'Dubai Spec', 'SUV', 'Used', '2022', 'Diesel', '18,000 km', '/assets/car-toyota.jpg', 1, 3),
('Mercedes GLE Coupe', 'American Spec', 'Luxury', 'Used', '2023', 'Petrol', '12,000 km', '/assets/car-mercedes.jpg', 1, 4),
('Mercedes S-Class 580', 'German Spec', 'Sedan', 'Brand New', '2024', 'Petrol', '0 km', '/assets/hero-car.jpg', 0, 0),
('BMW X7 M50i', 'Canadian Spec', 'SUV', 'Brand New', '2024', 'Petrol', '0 km', '/assets/car-suv.jpg', 0, 0),
('Range Rover Vogue', 'American Spec', 'Luxury', 'Used', '2022', 'Diesel', '25,000 km', '/assets/about-showroom.jpg', 0, 0),
('Audi Q8 e-tron', 'German Spec', 'Electric', 'Brand New', '2024', 'Electric', '0 km', '/assets/car-mercedes.jpg', 0, 0),
('Lexus LX 600', 'Dubai Spec', 'SUV', 'Used', '2023', 'Petrol', '8,000 km', '/assets/car-toyota.jpg', 0, 0);
