PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE Types (id INTEGER PRIMARY KEY, Name TEXT);
INSERT INTO Types VALUES(1,'attachment');
INSERT INTO Types VALUES(2,'dog');
INSERT INTO Types VALUES(3,'food');
INSERT INTO Types VALUES(4,'movement');
INSERT INTO Types VALUES(5,'personal');
INSERT INTO Types VALUES(6,'sled');
INSERT INTO Types VALUES(7,'utility');
INSERT INTO Types VALUES(8,'damage');

CREATE TABLE Decks (id INTEGER PRIMARY KEY, Name TEXT);
INSERT INTO Decks VALUES(1,'starter1');
INSERT INTO Decks VALUES(2,'starter2');
INSERT INTO Decks VALUES(3,'starter3');
INSERT INTO Decks VALUES(4,'starter4');
INSERT INTO Decks VALUES(10,'survival');
INSERT INTO Decks VALUES(11,'race');
INSERT INTO Decks VALUES(20,'legendary');
INSERT INTO Decks VALUES(21,'damage');

CREATE TABLE Effects (id INTEGER PRIMARY KEY, Name TEXT, Command TEXT);
INSERT INTO Effects VALUES(1,'Day Draw','\daydraw{#}');
INSERT INTO Effects VALUES(2,'Draw','\draw{#}');
INSERT INTO Effects VALUES(3,'Supply','\supply{#}');
INSERT INTO Effects VALUES(4,'Take','\take{#}');
INSERT INTO Effects VALUES(5,'See','\see{#}');
INSERT INTO Effects VALUES(6,'Destroy','\destroy{#}');
INSERT INTO Effects VALUES(7,'Speed','\speed{#}');
INSERT INTO Effects VALUES(8,'Move','\move{#}');
INSERT INTO Effects VALUES(10,'Discarded when killed','\discardonkill');
INSERT INTO Effects VALUES(11,'Play when the game starts','\inplayatstart');
INSERT INTO Effects VALUES(12,'Cannot Die','\immortal');
INSERT INTO Effects VALUES(13,'Passing does not incur damage','\safepass');
INSERT INTO Effects VALUES(14,'Dies when passing','\passdie');
INSERT INTO Effects VALUES(15,'Speed Times','\speed{$\times #$}');
INSERT INTO Effects VALUES(16,'Cannot hold attachments','\nohold');
INSERT INTO Effects VALUES(17,'Remove your starvation','\nostarvation');
INSERT INTO Effects VALUES(18,'Remove your hypothermia','\nohypothermia');
INSERT INTO Effects VALUES(19,'Take damage','\damage{#}');
INSERT INTO Effects VALUES(20,'Double the final distance','\doubledistance');
INSERT INTO Effects VALUES(21,'Damage Effect','\damagetext');

CREATE TABLE Cards (id INTEGER PRIMARY KEY, Name TEXT, Energy TEXT, Health TEXT, Risk TEXT, Flavour TEXT, Image TEXT, Type INTEGER REFERENCES Types (id));
INSERT INTO Cards VALUES(1,'A Hat',2,2,0,'I bet its a valve hat.','hat',1);
INSERT INTO Cards VALUES(2,'Dog Chow',1,3,0,'A hungry dog is a slow dog.','dog_chow',1);
INSERT INTO Cards VALUES(3,'Good Dog',3,3,0,'Good boy.','good_dog',2);
INSERT INTO Cards VALUES(4,'Husky',2,2,2,'Standard mushing fare.','husky',2);
INSERT INTO Cards VALUES(5,'Wheel Dog',3,3,0,'The dog right in front of the sled. Strong and steady.','wheel_dog',2);
INSERT INTO Cards VALUES(6,'Breakfast',0,3,0,'The most important meal of the day.','breakfast',3);
INSERT INTO Cards VALUES(7,'Lunch',2,0,0,'What about second breakfast?','lunch',3);
INSERT INTO Cards VALUES(8,'Dinner',2,2,0,'I hope you like salted fish.','dinner',3);
INSERT INTO Cards VALUES(9,'Move',0,0,0,'Just another day.','move',4);
INSERT INTO Cards VALUES(10,'Mush',2,2,1,'Comes from the french word `Marche''.','mush',4);
INSERT INTO Cards VALUES(11,'First Aid',2,2,0,'Reduces swelling.','first_aid',5);
INSERT INTO Cards VALUES(12,'Grandma Soup',1,2,1,'Cures what ails you.','grandma_soup',5);
INSERT INTO Cards VALUES(13,'Repair Sled',1,3,0,'It doesn''t need to be pretty. It just has to work.','repair_sled',6);
INSERT INTO Cards VALUES(14,'Upgrade Sled',2,2,0,'You have to keep your ride in top shape.','upgrade_sled',6);
INSERT INTO Cards VALUES(20,'Buffer Pannel',2,2,0,'Did the primary buffer panel just fall off my gorram ship for no apparent reason?','buffer_panel',1);
INSERT INTO Cards VALUES(21,'Nuclear Reactor',2,2,0,'What could go wrong?','nuclear_reactor',1);
INSERT INTO Cards VALUES(22,'Engineer Dog',3,5,1,'Nails and Gears.','engineer_dog',2);
INSERT INTO Cards VALUES(23,'Moose',5,0,3,'Majestic creatures. Hard to tame.','moose',2);
INSERT INTO Cards VALUES(24,'Waffle',0,0,0,'Waffles are \textbf{delicious}.','waffles',3);
INSERT INTO Cards VALUES(25,'Whale Meat',1,1,0,'It''s like rubber.','whale_meat',3);
INSERT INTO Cards VALUES(26,'Hitch a Ride',1,0,0,'Probably not in the spirit of the race.','hitch_a_ride',4);
INSERT INTO Cards VALUES(27,'Tactical Play',1,0,1,'Make the most of it.','tactical_play',4);
INSERT INTO Cards VALUES(28,'Meditate',1,1,0,'It \textit{is} just sitting.','meditate',5);
INSERT INTO Cards VALUES(29,'Diamorphine',1,1,1,'Highly addicting.','diamorphine',5);
INSERT INTO Cards VALUES(30,'Desperate Times',99,0,0,'Desperate Measures hotline, how may I help you?','desperate_times',6);
INSERT INTO Cards VALUES(31,'Lead Sled',1,1,1,'At least its not a Zeppelin.','lead_sled',6);
INSERT INTO Cards VALUES(32,'Damaged',1,1,0,'You have been hurt.','damaged',8);

CREATE TABLE Card_Effects (Card INTEGER REFERENCES Cards (id), Effect INTEGER REFERENCES Effects (id), Amount INTEGER);
INSERT INTO Card_Effects VALUES(1,1,1);
INSERT INTO Card_Effects VALUES(2,7,1);
INSERT INTO Card_Effects VALUES(3,1,1);
INSERT INTO Card_Effects VALUES(4,1,1);
INSERT INTO Card_Effects VALUES(4,7,1);
INSERT INTO Card_Effects VALUES(5,7,1);
INSERT INTO Card_Effects VALUES(5,10,1);
INSERT INTO Card_Effects VALUES(5,11,1);
INSERT INTO Card_Effects VALUES(6,2,3);
INSERT INTO Card_Effects VALUES(7,2,3);
INSERT INTO Card_Effects VALUES(8,2,7);
INSERT INTO Card_Effects VALUES(9,8,1);
INSERT INTO Card_Effects VALUES(10,8,10);
INSERT INTO Card_Effects VALUES(11,5,3);
INSERT INTO Card_Effects VALUES(11,6,1);
INSERT INTO Card_Effects VALUES(12,5,10);
INSERT INTO Card_Effects VALUES(12,6,2);
INSERT INTO Card_Effects VALUES(13,3,1);
INSERT INTO Card_Effects VALUES(13,4,2);
INSERT INTO Card_Effects VALUES(14,3,3);
INSERT INTO Card_Effects VALUES(14,4,1);
INSERT INTO Card_Effects VALUES(20,12,1);
INSERT INTO Card_Effects VALUES(20,13,1);
INSERT INTO Card_Effects VALUES(21,7,5);
INSERT INTO Card_Effects VALUES(21,14,1);
INSERT INTO Card_Effects VALUES(22,15,2);
INSERT INTO Card_Effects VALUES(22,16,1);
INSERT INTO Card_Effects VALUES(23,7,5);
INSERT INTO Card_Effects VALUES(23,12,1);
INSERT INTO Card_Effects VALUES(24,2,2);
INSERT INTO Card_Effects VALUES(25,2,5);
INSERT INTO Card_Effects VALUES(25,18,1);
INSERT INTO Card_Effects VALUES(26,8,6);
INSERT INTO Card_Effects VALUES(26,19,1);
INSERT INTO Card_Effects VALUES(27,8,0);
INSERT INTO Card_Effects VALUES(27,20,1);
INSERT INTO Card_Effects VALUES(28,5,99);
INSERT INTO Card_Effects VALUES(28,6,0);
INSERT INTO Card_Effects VALUES(29,5,99);
INSERT INTO Card_Effects VALUES(29,6,99);
INSERT INTO Card_Effects VALUES(30,3,10);
INSERT INTO Card_Effects VALUES(30,4,5);
INSERT INTO Card_Effects VALUES(31,3,10);
INSERT INTO Card_Effects VALUES(31,4,10);
INSERT INTO Card_Effects VALUES(32,21,1);

CREATE TABLE Deck_Cards (Deck INTEGER REFERENCES Decks (id), Card INTEGER REFERENCES Cards (id), Amount INTEGER);
INSERT INTO Deck_Cards VALUES(1,1,1);
INSERT INTO Deck_Cards VALUES(2,1,1);
INSERT INTO Deck_Cards VALUES(3,1,1);
INSERT INTO Deck_Cards VALUES(4,1,1);
INSERT INTO Deck_Cards VALUES(1,2,1);
INSERT INTO Deck_Cards VALUES(2,2,1);
INSERT INTO Deck_Cards VALUES(3,2,1);
INSERT INTO Deck_Cards VALUES(4,2,1);
INSERT INTO Deck_Cards VALUES(1,3,1);
INSERT INTO Deck_Cards VALUES(2,3,1);
INSERT INTO Deck_Cards VALUES(3,3,1);
INSERT INTO Deck_Cards VALUES(4,3,1);
INSERT INTO Deck_Cards VALUES(1,4,1);
INSERT INTO Deck_Cards VALUES(2,4,1);
INSERT INTO Deck_Cards VALUES(3,4,1);
INSERT INTO Deck_Cards VALUES(4,4,1);
INSERT INTO Deck_Cards VALUES(1,5,1);
INSERT INTO Deck_Cards VALUES(2,5,1);
INSERT INTO Deck_Cards VALUES(3,5,1);
INSERT INTO Deck_Cards VALUES(4,5,1);
INSERT INTO Deck_Cards VALUES(1,6,2);
INSERT INTO Deck_Cards VALUES(2,6,2);
INSERT INTO Deck_Cards VALUES(3,6,2);
INSERT INTO Deck_Cards VALUES(4,6,2);
INSERT INTO Deck_Cards VALUES(1,7,2);
INSERT INTO Deck_Cards VALUES(2,7,2);
INSERT INTO Deck_Cards VALUES(3,7,2);
INSERT INTO Deck_Cards VALUES(4,7,2);
INSERT INTO Deck_Cards VALUES(1,8,1);
INSERT INTO Deck_Cards VALUES(2,8,1);
INSERT INTO Deck_Cards VALUES(3,8,1);
INSERT INTO Deck_Cards VALUES(4,8,1);
INSERT INTO Deck_Cards VALUES(1,9,4);
INSERT INTO Deck_Cards VALUES(2,9,4);
INSERT INTO Deck_Cards VALUES(3,9,4);
INSERT INTO Deck_Cards VALUES(4,9,4);
INSERT INTO Deck_Cards VALUES(1,10,1);
INSERT INTO Deck_Cards VALUES(2,10,1);
INSERT INTO Deck_Cards VALUES(3,10,1);
INSERT INTO Deck_Cards VALUES(4,10,1);
INSERT INTO Deck_Cards VALUES(1,11,2);
INSERT INTO Deck_Cards VALUES(2,11,2);
INSERT INTO Deck_Cards VALUES(3,11,2);
INSERT INTO Deck_Cards VALUES(4,11,2);
INSERT INTO Deck_Cards VALUES(1,12,1);
INSERT INTO Deck_Cards VALUES(2,12,1);
INSERT INTO Deck_Cards VALUES(3,12,1);
INSERT INTO Deck_Cards VALUES(4,12,1);
INSERT INTO Deck_Cards VALUES(1,13,2);
INSERT INTO Deck_Cards VALUES(2,13,2);
INSERT INTO Deck_Cards VALUES(3,13,2);
INSERT INTO Deck_Cards VALUES(4,13,2);
INSERT INTO Deck_Cards VALUES(1,14,2);
INSERT INTO Deck_Cards VALUES(2,14,2);
INSERT INTO Deck_Cards VALUES(3,14,2);
INSERT INTO Deck_Cards VALUES(4,14,2);
INSERT INTO Deck_Cards VALUES(20,20,1);
INSERT INTO Deck_Cards VALUES(20,21,1);
INSERT INTO Deck_Cards VALUES(20,22,1);
INSERT INTO Deck_Cards VALUES(20,23,1);
INSERT INTO Deck_Cards VALUES(20,24,1);
INSERT INTO Deck_Cards VALUES(20,25,1);
INSERT INTO Deck_Cards VALUES(20,26,1);
INSERT INTO Deck_Cards VALUES(20,27,1);
INSERT INTO Deck_Cards VALUES(20,28,1);
INSERT INTO Deck_Cards VALUES(20,29,1);
INSERT INTO Deck_Cards VALUES(20,30,1);
INSERT INTO Deck_Cards VALUES(20,31,1);
INSERT INTO Deck_Cards VALUES(21,32,26);
COMMIT;
