PageRenderTime 30ms CodeModel.GetById 20ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 1ms

/mysql_create_tables_v1.sql

http://ghostcb.googlecode.com/
SQL | 97 lines | 91 code | 6 blank | 0 comment | 0 complexity | 2d320f80f3ba2aaa9dcf6c7d366e7425 MD5 | raw file
 1CREATE TABLE admins (
 2	id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
 3	botid INT NOT NULL,
 4	name VARCHAR(15) NOT NULL,
 5	server VARCHAR(100) NOT NULL
 6);
 7
 8CREATE TABLE bans (
 9	id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
10	botid INT NOT NULL,
11	server VARCHAR(100) NOT NULL,
12	name VARCHAR(15) NOT NULL,
13	ip VARCHAR(15) NOT NULL,
14	date DATETIME NOT NULL,
15	gamename VARCHAR(31) NOT NULL,
16	admin VARCHAR(15) NOT NULL,
17	reason VARCHAR(255) NOT NULL
18);
19
20CREATE TABLE games (
21	id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
22	botid INT NOT NULL,
23	server VARCHAR(100) NOT NULL,
24	map VARCHAR(100) NOT NULL,
25	datetime DATETIME NOT NULL,
26	gamename VARCHAR(31) NOT NULL,
27	ownername VARCHAR(15) NOT NULL,
28	duration INT NOT NULL,
29	gamestate INT NOT NULL,
30	creatorname VARCHAR(15) NOT NULL,
31	creatorserver VARCHAR(100) NOT NULL
32);
33
34CREATE TABLE gameplayers (
35	id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
36	botid INT NOT NULL,
37	gameid INT NOT NULL,
38	name VARCHAR(15) NOT NULL,
39	ip VARCHAR(15) NOT NULL,
40	spoofed INT NOT NULL,
41	reserved INT NOT NULL,
42	loadingtime INT NOT NULL,
43	`left` INT NOT NULL,
44	leftreason VARCHAR(100) NOT NULL,
45	team INT NOT NULL,
46	colour INT NOT NULL,
47	spoofedrealm VARCHAR(100) NOT NULL,
48	INDEX( gameid )
49);
50
51CREATE TABLE dotagames (
52	id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
53	botid INT NOT NULL,
54	gameid INT NOT NULL,
55	winner INT NOT NULL,
56	min INT NOT NULL,
57	sec INT NOT NULL
58);
59
60CREATE TABLE dotaplayers (
61	id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
62	botid INT NOT NULL,
63	gameid INT NOT NULL,
64	colour INT NOT NULL,
65	kills INT NOT NULL,
66	deaths INT NOT NULL,
67	creepkills INT NOT NULL,
68	creepdenies INT NOT NULL,
69	assists INT NOT NULL,
70	gold INT NOT NULL,
71	neutralkills INT NOT NULL,
72	item1 CHAR(4) NOT NULL,
73	item2 CHAR(4) NOT NULL,
74	item3 CHAR(4) NOT NULL,
75	item4 CHAR(4) NOT NULL,
76	item5 CHAR(4) NOT NULL,
77	item6 CHAR(4) NOT NULL,
78	hero CHAR(4) NOT NULL,
79	newcolour INT NOT NULL,
80	towerkills INT NOT NULL,
81	raxkills INT NOT NULL,
82	courierkills INT NOT NULL,
83	INDEX( gameid, colour )
84);
85
86CREATE TABLE downloads (
87	id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
88	botid INT NOT NULL,
89	map VARCHAR(100) NOT NULL,
90	mapsize INT NOT NULL,
91	datetime DATETIME NOT NULL,
92	name VARCHAR(15) NOT NULL,
93	ip VARCHAR(15) NOT NULL,
94	spoofed INT NOT NULL,
95	spoofedrealm VARCHAR(100) NOT NULL,
96	downloadtime INT NOT NULL
97);