diff --git a/database/db_scripts/fill_products.sql b/database/db_scripts/fill_products.sql new file mode 100644 index 0000000..757f560 --- /dev/null +++ b/database/db_scripts/fill_products.sql @@ -0,0 +1,30 @@ +INSERT INTO webshop.product_inventory (id) VALUE (1); + +INSERT INTO webshop.product (model, color, engine, description, make, + discount_id, created_at, name, + deleted_at, modified_at, price, inventory_id, category_id) + VALUES +-- Example row 1 +('Model X', 'Red', 'V8', 'A powerful red car', 'Tesla', + FLOOR(1 + RAND() * 5), UNIX_TIMESTAMP(), 'Red Thunder', + 1, UNIX_TIMESTAMP(), ROUND(50000 + (RAND() * 50000), 2), id, 1), + +-- Example row 2 +('Civic', 'Blue', 'I4', 'Efficient and reliable', 'Honda', + FLOOR(1 + RAND() * 5), UNIX_TIMESTAMP(), 'Blue Breeze', + 1, UNIX_TIMESTAMP(), ROUND(20000 + (RAND() * 15000), 2), id, 1), + +-- Example row 3 +('Mustang', 'Black', 'V6', 'A sleek muscle car', 'Ford', + FLOOR(1 + RAND() * 5), UNIX_TIMESTAMP(), 'Black Panther', + 1, UNIX_TIMESTAMP(), ROUND(30000 + (RAND() * 20000), 2), id, 1), + +-- Example row 4 +('Camry', 'White', 'Hybrid', 'Eco-friendly and spacious', 'Toyota', + FLOOR(1 + RAND() * 5), UNIX_TIMESTAMP(), 'White Cloud', + 1, UNIX_TIMESTAMP(), ROUND(25000 + (RAND() * 10000), 2), id, 1), + +-- Example row 5 +('A4', 'Gray', 'V6 Turbo', 'Luxury and performance', 'Audi', + FLOOR(1 + RAND() * 5), UNIX_TIMESTAMP(), 'Gray Ghost', + 1, UNIX_TIMESTAMP(), ROUND(40000 + (RAND() * 30000), 2), id, 1); \ No newline at end of file diff --git a/database/db_scripts/fill_database.sql b/database/db_scripts/fill_users.sql similarity index 98% rename from database/db_scripts/fill_database.sql rename to database/db_scripts/fill_users.sql index c923fcd..d21e23b 100644 --- a/database/db_scripts/fill_database.sql +++ b/database/db_scripts/fill_users.sql @@ -12,5 +12,4 @@ BEGIN VALUES ('1', 'harry', 'potter', readyEmailString); SET i = i + 1; END WHILE; -END; - +END; \ No newline at end of file