WIP: update to include sectors!
[browser-rts.git] / dump.sql
1 BEGIN TRANSACTION;
2 CREATE TABLE IF NOT EXISTS "accounts" (
3         "id"    text,
4         "username"      text UNIQUE,
5         "password"      text,
6         PRIMARY KEY("id")
7 );
8 CREATE TABLE IF NOT EXISTS "cities" (
9         "id"    string,
10         "owner" string,
11         "totalSpace"    int,
12         "usedSpace"     int,
13         "gold"  int,
14         "ore"   int,
15         "logs"  int,
16         "bushels"       int,
17         "population"    int,
18         "soliders"      int,
19         "attackers"     int,
20         "defenders"     int,
21         "sp_attackers"  int,
22         "sp_defenders"  int,
23         "soldiers"      int after population,
24         "farms" int,
25         "barracks"      int,
26         "special_attacker_trainer"      int,
27         "special_defender_trainer"      int,
28         PRIMARY KEY("id")
29 );
30 CREATE TABLE IF NOT EXISTS "locations" (
31         "sector_id"             int,
32         "city_id"               text unique,
33         "location_x"    int,
34         "location_y"    int
35 );
36 CREATE TABLE IF NOT EXISTS "ticks" (
37         "current_tick"  int,
38         "last_tick_at"  int
39 );
40 CREATE TABLE IF NOT EXISTS "sessions" (
41         "id"    text,
42         "account_id"    TEXT,
43         PRIMARY KEY("id")
44 );
45 CREATE TABLE IF NOT EXISTS "build_queues" (
46         "id"    text,
47         "building_type" text,
48         "owner" text,
49         "created"       int,
50         "due"   int,
51         "amount"        int,
52         PRIMARY KEY("id")
53 );
54 CREATE TABLE IF NOT EXISTS "unit_training_queue" (
55         "id"    string,
56         "unit_type"     text,
57         "owner" text,
58         "created"       int,
59         "due"   int,
60         "amount"        int,
61         PRIMARY KEY("id")
62 );
63 CREATE TABLE IF NOT EXISTS "buildings" (
64         "slug"  text,
65         "display"       text UNIQUE,
66         "gold"  int,
67         "ore"   int,
68         "logs"  int,
69         "land"  int,
70         "time"  int,
71         PRIMARY KEY("slug")
72 );
73 CREATE TABLE IF NOT EXISTS "units" (
74         "slug"  ,
75         "display"       ,
76         "gold"  ,
77         "bushels"       ,
78         "population"    ,
79         "soldiers"      ,
80         "attackers"     ,
81         "defenders"     ,
82         "time"  ,
83         "attack"        int,
84         "defence"       int
85 );
86 CREATE TABLE IF NOT EXISTS "army_queue" (
87         "id"    text,
88         "owner" text,
89         "your_city"     text,
90         "created"       int,
91         "due"   int,
92         "soldiers"      int,
93         "attackers"     int,
94         "defenders"     int,
95         "sp_attackers"  int,
96         "sp_defenders"  int,
97         "attacked_city" text,
98         PRIMARY KEY("id")
99 );
100 CREATE TABLE IF NOT EXISTS "mail" (
101         "id"    text,
102         "to_account"    text,
103         "from_account"  text,
104         "type"  text,
105         "sent_at"       int,
106         "read_at"       int,
107         "subject"       text,
108         "message"       text,
109         PRIMARY KEY("id")
110 );
111 INSERT INTO "accounts" VALUES ('-','Advisor','xos');
112 INSERT INTO "locations" VALUES (1, '-', -1, -1);
113 INSERT INTO "buildings" VALUES ('farms','Farms',20,0,40,1,14);
114 INSERT INTO "buildings" VALUES ('barracks','Barracks',40,10,60,1,16);
115 INSERT INTO "buildings" VALUES ('special_attacker_trainer','Sp. Attacker Trainer',80,40,100,2,20);
116 INSERT INTO "buildings" VALUES ('special_defender_trainer','Sp. Defender Trainer',100,60,80,2,20);
117 INSERT INTO "units" VALUES ('soldiers','Soldiers',2,1,1,0,0,0,2,2.1,1);
118 INSERT INTO "units" VALUES ('attackers','Attackers',5,2,0,1,0,0,3,4,1);
119 INSERT INTO "units" VALUES ('defenders','Defenders',4,2,0,1,0,0,5,1,4);
120 INSERT INTO "units" VALUES ('sp_attackers','Sp. Attacker',9,4,0,0,1,0,7,7,3);
121 INSERT INTO "units" VALUES ('sp_defenders','Sp. Defender',11,5,0,0,0,1,10,2,9);