- added script to fill product table [WIP]
This commit is contained in:
parent
0482eeec59
commit
1e0aea7fd5
30
database/db_scripts/fill_products.sql
Normal file
30
database/db_scripts/fill_products.sql
Normal file
@ -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);
|
||||||
@ -13,4 +13,3 @@ BEGIN
|
|||||||
SET i = i + 1;
|
SET i = i + 1;
|
||||||
END WHILE;
|
END WHILE;
|
||||||
END;
|
END;
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user