-- Creates a new database when a new game is created
-- @author Eric Pietrocupo
-- @date March 29th, 2026
-- @license GNU GPL 3.0
--
-- I had to split the test script to replace gennerated holdings.
-- must be used in with test.sql

-- Change some variant rules on demand
--UPDATE variant SET isenabled = 'Y' WHERE pk = 0; -- DIV goes up
UPDATE variant SET isenabled = 'Y' WHERE pk = 2; -- cards

-- Change the stock market default value
UPDATE stock SET current_price = 120 WHERE pk = 0;
UPDATE stock SET current_price = 145 WHERE pk = 1;
UPDATE stock SET current_price = 155 WHERE pk = 2;
UPDATE stock SET current_price = 80 WHERE pk = 3;
UPDATE stock SET current_price = 85 WHERE pk = 4;
UPDATE stock SET current_price = 50 WHERE pk = 5;
UPDATE stock SET previous_price = 100 WHERE pk = 0;
UPDATE stock SET previous_price = 140 WHERE pk = 1;
UPDATE stock SET previous_price = 165 WHERE pk = 2;
UPDATE stock SET previous_price = 90 WHERE pk = 3;
UPDATE stock SET previous_price = 65 WHERE pk = 4;
UPDATE stock SET previous_price = 70 WHERE pk = 5;

-- Insert holdings
DELETE FROM holding;

INSERT INTO holding (fk_player, fk_stock, quantity, cost)
VALUES
(1, 0, 1500, 1750),
(1, 1, 2500, 2300),
(1, 2, 4500, 4000),
(1, 3, 2000, 2800),
(1, 4, 0, 0),
(1, 5, 0, 0),
(2, 0, 0, 0),
(2, 1, 0, 0),
(2, 2, 3500, 3625),
(2, 3, 1000, 1000),
(2, 4, 2500, 4750),
(2, 5, 5000, 3825),
(3, 0, 0, 0),
(3, 1, 2000, 2000),
(3, 2, 0, 0),
(3, 3, 4000, 4275),
(3, 4, 0, 0),
(3, 5, 3000, 2800),
(4, 0, 1500, 1250),
(4, 1, 2500, 2800) ,
(4, 2, 4500, 4100),
(4, 3, 2000, 1500),
(4, 4, 0, 0),
(4, 5, 0, 0),
(5, 0, 0, 0),
(5, 1, 0, 0),
(5, 2, 3500, 3800),
(5, 3, 1000, 600),
(5, 4, 2500, 2175),
(5, 5, 5000, 8000),
(6, 0, 0, 0),
(6, 1, 2000, 1250),
(6, 2, 0, 0),
(6, 3, 4000, 3500),
(6, 4, 0, 0),
(6, 5, 3000, 3850);
