CREATE TABLE Gifts ( -> id INT AUTO_INCREMENT PRIMARY KEY, -> lvl INT NOT NULL, -> iconUrl VARCHAR(255), -> name VARCHAR(255) NOT NULL, -> type ENUM('item', 'product', 'service', 'privilege', 'set') NOT NULL -> ); INSERT INTO Gifts (lvl, iconUrl, name, type) VALUES (1, 'src/icons/lvl1.png', 'Rifle M39', 'item'), (2, 'src/icons/lvl2.png', 'Assault Rifle', 'item'), (3, 'src/icons/lvl3.png', '500 Silver Coins', 'product'), (4, 'src/icons/lvl4.png', 'Metabolism for 7 Days', 'service'), (5, 'src/icons/lvl5.png', 'Recycler', 'item'), (6, 'src/icons/lvl6.png', 'LMG M249', 'item'), (7, 'src/icons/lvl7.png', 'Workbench Level 3', 'item'), (8, 'src/icons/lvl8.png', 'VIP', 'privilege'), (9, 'src/icons/lvl9.png', 'Raider Set', 'set'), (10, 'src/icons/lvl10.png', '5 Levels of Battle Pass', 'service'), (11, 'src/icons/lvl11.png', 'GOD Kits', 'service'), (12, 'src/icons/lvl12.png', '10000 Silver Coins', 'product'), (13, 'src/icons/lvl13.png', '+100% Battle Pass Experience', 'product'), (14, 'src/icons/lvl14.png', 'GOD', 'privilege'), (15, 'src/icons/lvl15.png', 'Unique Nick Color + Respawn Set', 'item'), (16, 'src/icons/lvl16.png', '25 Levels of Magic Pass', 'product'), (17, 'src/icons/lvl17.png', 'All Recipes', 'product'), (18, 'src/icons/lvl18.png', 'All Privileges for 6 Days', 'privilege'), (19, 'src/icons/lvl19.png', 'Priority Queue on Main/Long Servers for 90 Days', 'service'), (20, 'src/icons/lvl20.png', '50000 Silver', 'product'), (21, 'src/icons/lvl21.png', 'Unique Set and Prefix [DONATER] in Red', 'item'); CREATE TABLE UserGifts ( userId INT, giftId INT, PRIMARY KEY (userId, giftId), FOREIGN KEY (userId) REFERENCES User(id) ON DELETE CASCADE, FOREIGN KEY (giftId) REFERENCES Gifts(id) ON DELETE CASCADE ); ALTER TABLE UserGifts ADD COLUMN amount INT DEFAULT 0; ALTER TABLE Product ADD COLUMN isGift TINYINT(1) DEFAULT 0, ADD COLUMN lvl INT DEFAULT NULL, ADD COLUMN iconUrl VARCHAR(255) DEFAULT NULL; INSERT INTO Product (name_ru, name_en, type, image, iconUrl, isGift, lvl, price, amount, hidden) VALUES ('Rifle M39', 'Rifle M39', 'GAME_ITEM', 'src/icons/lvl1.png', 'src/icons/lvl1.png', true, 1, 100, 1, 1), ('Assault Rifle', 'Assault Rifle', 'GAME_ITEM', 'src/icons/lvl2.png', 'src/icons/lvl2.png', true, 2, 150, 1, 1), ('500 Silver Coins', '500 Silver Coins', 'CURRENCY', 'src/icons/lvl3.png', 'src/icons/lvl3.png', true, 3, 500, 1, 1), ('Metabolism for 7 Days', 'Metabolism for 7 Days', 'SERVICE', 'src/icons/lvl4.png', 'src/icons/lvl4.png', true, 4, 200, 1, 1), ('Recycler', 'Recycler', 'GAME_ITEM', 'src/icons/lvl5.png', 'src/icons/lvl5.png', true, 5, 80, 1, 1), ('LMG M249', 'LMG M249', 'GAME_ITEM', 'src/icons/lvl6.png', 'src/icons/lvl6.png', true, 6, 120, 1, 1), ('Workbench Level 3', 'Workbench Level 3', 'GAME_ITEM', 'src/icons/lvl7.png', 'src/icons/lvl7.png', true, 7, 200, 1, 1), ('VIP', 'VIP', 'SERVICE', 'src/icons/lvl8.png', 'src/icons/lvl8.png', true, 8, 300, 1, 1), ('Raider Set', 'Raider Set', 'SETS_OF_PRODUCTS', 'src/icons/lvl9.png', 'src/icons/lvl9.png', true, 9, 400, 1, 1), ('5 Levels of Battle Pass', '5 Levels of Battle Pass', 'SERVICE', 'src/icons/lvl10.png', 'src/icons/lvl10.png', true, 10, 250, 1, 1), ('GOD Kits', 'GOD Kits', 'SERVICE', 'src/icons/lvl11.png', 'src/icons/lvl11.png', true, 11, 350, 1, 1), ('10000 Silver Coins', '10000 Silver Coins', 'CURRENCY', 'src/icons/lvl12.png', 'src/icons/lvl12.png', true, 12, 10000, 1, 1), ('+100% Battle Pass Experience', '+100% Battle Pass Experience', 'CURRENCY', 'src/icons/lvl13.png', 'src/icons/lvl13.png', true, 13, 600, 1, 1), ('GOD', 'GOD', 'SERVICE', 'src/icons/lvl14.png', 'src/icons/lvl14.png', true, 14, 500, 1, 1), ('Unique Nick Color + Respawn Set', 'Unique Nick Color + Respawn Set', 'GAME_ITEM', 'src/icons/lvl15.png', 'src/icons/lvl15.png', true, 15, 90, 1, 1), ('25 Levels of Magic Pass', '25 Levels of Magic Pass', 'CURRENCY', 'src/icons/lvl16.png', 'src/icons/lvl16.png', true, 16, 750, 1, 1), ('All Recipes', 'All Recipes', 'CURRENCY', 'src/icons/lvl17.png', 'src/icons/lvl17.png', true, 17, 300, 1, 1), ('All Privileges for 6 Days', 'All Privileges for 6 Days', 'SERVICE', 'src/icons/lvl18.png', 'src/icons/lvl18.png', true, 18, 450, 1, 1), ('Priority Queue on Main/Long Servers for 90 Days', 'Priority Queue on Main/Long Servers for 90 Days', 'SERVICE', 'src/icons/lvl19.png', 'src/icons/lvl19.png', true, 19, 550, 1, 1), ('50000 Silver', '50000 Silver', 'CURRENCY', 'src/icons/lvl20.png', 'src/icons/lvl20.png', true, 20, 50000, 1, 1), ('Unique Set and Prefix [DONATER] in Red', 'Unique Set and Prefix [DONATER] in Red', 'GAME_ITEM', 'src/icons/lvl21.png', 'src/icons/lvl21.png', true, 21, 120, 1, 1); ALTER TABLE Inventory MODIFY historyOfPurchaseId INT NULL;