CREATE DATABASE IF NOT EXISTS nerdshop CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; USE nerdshop; DROP TABLE IF EXISTS products; CREATE TABLE products ( id CHAR(24) NOT NULL, title VARCHAR(255) NOT NULL, sku VARCHAR(32) NOT NULL, stock INT UNSIGNED NOT NULL DEFAULT 0, price DECIMAL(10,2) NOT NULL, description TEXT NOT NULL, tagline VARCHAR(255) NOT NULL, PRIMARY KEY (id), UNIQUE KEY uq_products_sku (sku) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; INSERT INTO products (id, title, sku, stock, price, description, tagline) VALUES ('675bee96bb39023b77e6cd92', 'Smart Coffee Mug with LCD Level Indicator', 'MUG0007', 25, 49.99, 'Know exactly how much coffee you have left with this LCD-equipped mug.', 'Never face an empty mug again.'), ('675bee96bb39023b77e6cd93', 'Bluetooth Coffee Mug with Fortune Telling Scanner', 'MUG0013', 15, 99.99, 'Get your daily fortune with every sip using this Bluetooth-connected mug.', 'Coffee reading, made smart.'), ('675bee96bb39023b77e6cd94', 'South Pole Tested Pre-Warmed Ink Pen', 'OFF3145', 34, 29.95, 'Write smoothly even in the coldest conditions with this pre-warmed ink pen.', 'The pen that conquers the cold.'), ('675bee96bb39023b77e6cd95', 'Ambidextrous Computer Mouse', 'COM1001', 50, 19.90, 'Finally, a mouse designed for both left and right-handed users.', 'End the left-right struggle.'), ('675bee96bb39023b77e6cd96', 'Easter Egg Themed Webcam', 'COM0404', 8, 14.99, 'Add some festive flair to your video calls with this Easter egg webcam.', 'Happy Easter, every day.'), ('675bee96bb39023b77e6cd97', 'Vulcan Language vi Cheatsheet', 'COM0001', 6, 9.90, 'Master the Vulcan language and vi editor simultaneously with this handy cheatsheet.', 'Learn vi and Vulcan, live long and prosper.'), ('675bee96bb39023b77e6cd98', 'Klingon Language emacs Cheatsheet', 'COM1536', 33, 9.90, 'Conquer the Klingon language and emacs with this comprehensive cheatsheet.', 'Learn emacs and Klingon, qapla''!'), ('675bee96bb39023b77e6cda0', 'Self-Folding Laundry Basket', 'HME0023', 15, 79.99, 'Say goodbye to laundry clutter with this self-folding basket.', 'Laundry day just got easier.'), ('675bee96bb39023b77e6cda1', 'Noise-Cancelling Headphones for Cats', 'PET0112', 39, 39.95, 'Give your cat the gift of silence with these noise-canceling headphones.', 'Purrfect tranquility for your feline friend.'), ('675bee96bb39023b77e6cda2', 'Glow-in-the-Dark Toilet Paper', 'HME0221', 65, 12.50, 'Navigate your midnight bathroom trips with ease using this glow-in-the-dark toilet paper.', 'A guiding light in the darkness.'), ('675bee96bb39023b77e6cda3', 'Automatic Plant Waterer with Compliment Dispenser', 'GRD0334', 17, 69.99, 'Keep your plants happy and hydrated with automatic watering and daily compliments.', 'Nurture your plants, boost their self-esteem.'), ('675bee96bb39023b77e6cda4', 'Self-Stirring Cereal Bowl', 'KIT0445', 55, 24.95, 'Enjoy perfectly crunchy cereal every time with this self-stirring bowl.', 'No more soggy surprises.'), ('675bee96bb39023b77e6cda5', 'Polygon Planet Lamp', 'LMP0556', 4, 39.90, 'Transform your space with the enchanting glow of a planetarium-inspired lamp.', 'Bring the cosmos into your home.'); CREATE TABLE IF NOT EXISTS users ( id INT UNSIGNED NOT NULL AUTO_INCREMENT, username VARCHAR(64) NOT NULL, email VARCHAR(255) NOT NULL, password_hash VARCHAR(255) NOT NULL, token VARCHAR(64) NULL DEFAULT NULL, created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (id), UNIQUE KEY uq_users_username (username), UNIQUE KEY uq_users_email (email), KEY idx_users_token (token) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; INSERT INTO users (username, email, password_hash) VALUES ( 'megaman', 'order@gkontra.de', '$2y$12$CdOg.e08jP968kQoA298Ne92r9pyEYBfSya4gFWQCh.X8gJhmDaVW' ) ON DUPLICATE KEY UPDATE email = VALUES(email), password_hash = VALUES(password_hash);