]> de.git.xonotic.org Git - xonotic/xonstatdb.git/blob - tables/player_weapon_stats.tab
Remove nick from weapon stats and replace it w/ pgstat id. Remove corresponding const...
[xonotic/xonstatdb.git] / tables / player_weapon_stats.tab
1 CREATE TABLE xonstat.player_weapon_stats
2 (
3   player_weapon_stats_id bigserial NOT NULL,
4   player_id integer NOT NULL,
5   game_id bigint NOT NULL,
6   player_game_stat_id bigint NOT NULL,
7   weapon_cd character varying(15) NOT NULL,
8   actual integer NOT NULL default 0,
9   max integer NOT NULL default 0,
10   hit integer NOT NULL default 0,
11   fired integer NOT NULL default 0,
12   frags integer NOT NULL default 0,
13   create_dt timestamp without time zone NOT NULL DEFAULT now(),
14   CONSTRAINT player_weapon_stats_pk PRIMARY KEY (player_weapon_stats_id),
15   CONSTRAINT player_weapon_stats_fk001 FOREIGN KEY (player_id)
16       REFERENCES xonstat.players (player_id) MATCH SIMPLE
17       ON UPDATE NO ACTION ON DELETE NO ACTION,
18   CONSTRAINT player_weapon_stats_fk002 FOREIGN KEY (game_id)
19       REFERENCES xonstat.games (game_id) MATCH SIMPLE
20       ON UPDATE NO ACTION ON DELETE NO ACTION,
21   CONSTRAINT player_weapon_stats_fk003 FOREIGN KEY (weapon_cd)
22       REFERENCES xonstat.cd_weapon (weapon_cd) MATCH SIMPLE
23       ON UPDATE NO ACTION ON DELETE NO ACTION,
24   CONSTRAINT player_weapon_stats_fk004 FOREIGN KEY (player_game_stat_id)
25       REFERENCES xonstat.player_game_stats (player_game_stat_id) MATCH SIMPLE
26       ON UPDATE NO ACTION ON DELETE NO ACTION
27 )
28 WITH (
29   OIDS=FALSE
30 );
31 CREATE INDEX player_weap_stats_ix01 on player_weapon_stats(create_dt);
32 ALTER TABLE xonstat.player_weapon_stats OWNER TO xonstat;
33
34 CREATE TABLE xonstat.player_weapon_stats_2011Q2 (
35     CHECK ( create_dt >= DATE '2011-04-01' AND create_dt < DATE '2011-07-01' ) 
36 ) INHERITS (player_weapon_stats);
37 CREATE INDEX player_weap_stats_2011Q2_ix01 on player_weapon_stats_2011Q2(create_dt);
38 ALTER TABLE xonstat.player_weapon_stats_2011Q2 OWNER TO xonstat;
39
40 CREATE TABLE xonstat.player_weapon_stats_2011Q3 ( 
41     CHECK ( create_dt >= DATE '2011-07-01' AND create_dt < DATE '2011-10-01' ) 
42 ) INHERITS (player_weapon_stats);
43 CREATE INDEX player_weap_stats_2011Q3_ix01 on player_weapon_stats_2011Q3(create_dt);
44 ALTER TABLE xonstat.player_weapon_stats_2011Q3 OWNER TO xonstat;
45
46 CREATE TABLE xonstat.player_weapon_stats_2011Q4 ( 
47     CHECK ( create_dt >= DATE '2011-10-01' AND create_dt < DATE '2012-01-01' ) 
48 ) INHERITS (player_weapon_stats);
49 CREATE INDEX player_weap_stats_2011Q4_ix01 on player_weapon_stats_2011Q4(create_dt);
50 ALTER TABLE xonstat.player_weapon_stats_2011Q4 OWNER TO xonstat;
51
52 CREATE TABLE xonstat.player_weapon_stats_2012Q1 ( 
53     CHECK ( create_dt >= DATE '2012-01-01' AND create_dt < DATE '2012-04-01' ) 
54 ) INHERITS (player_weapon_stats);
55 CREATE INDEX player_weap_stats_2012Q1_ix01 on player_weapon_stats_2012Q1(create_dt);
56 ALTER TABLE xonstat.player_weapon_stats_2012Q1 OWNER TO xonstat;
57
58 CREATE TABLE xonstat.player_weapon_stats_2012Q2 ( 
59     CHECK ( create_dt >= DATE '2012-04-01' AND create_dt < DATE '2012-07-01' ) 
60 ) INHERITS (player_weapon_stats);
61 CREATE INDEX player_weap_stats_2012Q2_ix01 on player_weapon_stats_2012Q2(create_dt);
62 ALTER TABLE xonstat.player_weapon_stats_2012Q2 OWNER TO xonstat;
63
64 CREATE TABLE xonstat.player_weapon_stats_2012Q3 ( 
65     CHECK ( create_dt >= DATE '2012-07-01' AND create_dt < DATE '2012-10-01' ) 
66 ) INHERITS (player_weapon_stats);
67 CREATE INDEX player_weap_stats_2012Q3_ix01 on player_weapon_stats_2012Q3(create_dt);
68 ALTER TABLE xonstat.player_weapon_stats_2012Q3 OWNER TO xonstat;
69
70 CREATE TABLE xonstat.player_weapon_stats_2012Q4 ( 
71     CHECK ( create_dt >= DATE '2012-10-01' AND create_dt < DATE '2013-01-01' ) 
72 ) INHERITS (player_weapon_stats);
73 CREATE INDEX player_weap_stats_2012Q4_ix01 on player_weapon_stats_2012Q4(create_dt);
74 ALTER TABLE xonstat.player_weapon_stats_2012Q4 OWNER TO xonstat;
75
76 CREATE TABLE xonstat.player_weapon_stats_2013Q1 ( 
77     CHECK ( create_dt >= DATE '2013-01-01' AND create_dt < DATE '2013-04-01' ) 
78 ) INHERITS (player_weapon_stats);
79 CREATE INDEX player_weap_stats_2013Q1_ix01 on player_weapon_stats_2013Q1(create_dt);
80 ALTER TABLE xonstat.player_weapon_stats_2013Q1 OWNER TO xonstat;
81
82 CREATE TABLE xonstat.player_weapon_stats_2013Q2 ( 
83     CHECK ( create_dt >= DATE '2013-04-01' AND create_dt < DATE '2013-07-01' ) 
84 ) INHERITS (player_weapon_stats);
85 CREATE INDEX player_weap_stats_2013Q2_ix01 on player_weapon_stats_2013Q2(create_dt);
86 ALTER TABLE xonstat.player_weapon_stats_2013Q2 OWNER TO xonstat;