CREATE TABLE IF NOT EXISTS restaurants (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(255) NOT NULL,
    description TEXT,
    image_url VARCHAR(255)
);

CREATE TABLE IF NOT EXISTS menu_items (
    id INT AUTO_INCREMENT PRIMARY KEY,
    restaurant_id INT NOT NULL,
    name VARCHAR(255) NOT NULL,
    description TEXT,
    price DECIMAL(10, 2) NOT NULL,
    image_url VARCHAR(255),
    FOREIGN KEY (restaurant_id) REFERENCES restaurants(id) ON DELETE CASCADE
);

-- Seed data for restaurants
INSERT INTO restaurants (name, description, image_url) VALUES
('Pizza Palace', 'The best pizza in town. Made with fresh, locally-sourced ingredients.', 'assets/images/placeholder.jpg'),
('Burger Barn', 'Home of the juiciest burgers and crispiest fries. A family favorite.', 'assets/images/placeholder.jpg'),
('Taco Town', 'Authentic Mexican street tacos, burritos, and more. A flavor fiesta!', 'assets/images/placeholder.jpg');

-- Seed data for menu_items
INSERT INTO menu_items (restaurant_id, name, description, price, image_url) VALUES
-- Pizza Palace
(1, 'Margherita Pizza', 'Classic cheese and tomato pizza with a touch of basil.', 12.99, 'assets/images/placeholder.jpg'),
(1, 'Pepperoni Pizza', 'A classic favorite, loaded with premium pepperoni.', 14.99, 'assets/images/placeholder.jpg'),
(1, 'Veggie Supreme', 'A delicious mix of fresh garden vegetables on our signature crust.', 15.99, 'assets/images/placeholder.jpg'),

-- Burger Barn
(2, 'Classic Burger', 'A timeless 1/4 lb beef patty with lettuce, tomato, and our secret sauce.', 9.99, 'assets/images/placeholder.jpg'),
(2, 'Cheese Burger', 'Our classic burger with a slice of melted American cheese.', 10.99, 'assets/images/placeholder.jpg'),
(2, 'Bacon Deluxe', 'For the bacon lovers! Our cheese burger topped with crispy bacon.', 11.99, 'assets/images/placeholder.jpg'),

-- Taco Town
(3, 'Carne Asada Taco', 'Grilled steak taco on a fresh corn tortilla with cilantro and onions.', 3.50, 'assets/images/placeholder.jpg'),
(3, 'Al Pastor Taco', 'Marinated pork taco with pineapple, cilantro, and onions.', 3.50, 'assets/images/placeholder.jpg'),
(3, 'Chicken Tinga Burrito', 'A large flour tortilla filled with shredded chicken, rice, beans, and cheese.', 8.99, 'assets/images/placeholder.jpg');
