PageRenderTime 62ms CodeModel.GetById 23ms app.highlight 35ms RepoModel.GetById 1ms app.codeStats 0ms

/mysql_create_tables_v2.sql

http://ghostcb.googlecode.com/
SQL | 128 lines | 119 code | 9 blank | 0 comment | 0 complexity | ef70a9e8688fd20fa9547a7f307bc1b2 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);
 98
 99CREATE TABLE scores (
100	id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
101	category VARCHAR(25) NOT NULL,
102	name VARCHAR(15) NOT NULL,
103	server VARCHAR(100) NOT NULL,
104	score REAL NOT NULL
105);
106
107CREATE TABLE w3mmdplayers (
108	id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
109	botid INT NOT NULL,
110	category VARCHAR(25) NOT NULL,
111	gameid INT NOT NULL,
112	pid INT NOT NULL,
113	name VARCHAR(15) NOT NULL,
114	flag VARCHAR(32) NOT NULL,
115	leaver INT NOT NULL,
116	practicing INT NOT NULL
117);
118
119CREATE TABLE w3mmdvars (
120	id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
121	botid INT NOT NULL,
122	gameid INT NOT NULL,
123	pid INT NOT NULL,
124	varname VARCHAR(25) NOT NULL,
125	value_int INT DEFAULT NULL,
126	value_real REAL DEFAULT NULL,
127	value_string VARCHAR(100) DEFAULT NULL
128);