1 CREATE TABLE xonstat.player_weapon_stats
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 (current_timestamp at time zone 'UTC'),
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
32 CREATE INDEX player_weap_stats_ix01 on player_weapon_stats(create_dt);
33 CREATE INDEX player_weap_stats_ix02 on player_weapon_stats(game_id);
34 CREATE INDEX player_weap_stats_ix03 on player_weapon_stats(player_id);
35 ALTER TABLE xonstat.player_weapon_stats OWNER TO xonstat;
37 CREATE TABLE xonstat.player_weapon_stats_2011Q2 (
38 CHECK ( create_dt >= DATE '2011-04-01' AND create_dt < DATE '2011-07-01' )
39 ) INHERITS (player_weapon_stats);
41 CREATE INDEX player_weap_stats_2011Q2_ix01 on player_weapon_stats_2011Q2(create_dt);
42 CREATE INDEX player_weap_stats_2011Q2_ix02 on player_weapon_stats_2011Q2(game_id);
43 CREATE INDEX player_weap_stats_2011Q2_ix03 on player_weapon_stats_2011Q2(player_id);
44 ALTER TABLE xonstat.player_weapon_stats_2011Q2 OWNER TO xonstat;
46 CREATE TABLE xonstat.player_weapon_stats_2011Q3 (
47 CHECK ( create_dt >= DATE '2011-07-01' AND create_dt < DATE '2011-10-01' )
48 ) INHERITS (player_weapon_stats);
50 CREATE INDEX player_weap_stats_2011Q3_ix01 on player_weapon_stats_2011Q3(create_dt);
51 CREATE INDEX player_weap_stats_2011Q3_ix02 on player_weapon_stats_2011Q3(game_id);
52 CREATE INDEX player_weap_stats_2011Q3_ix03 on player_weapon_stats_2011Q3(player_id);
53 ALTER TABLE xonstat.player_weapon_stats_2011Q3 OWNER TO xonstat;
55 CREATE TABLE xonstat.player_weapon_stats_2011Q4 (
56 CHECK ( create_dt >= DATE '2011-10-01' AND create_dt < DATE '2012-01-01' )
57 ) INHERITS (player_weapon_stats);
59 CREATE INDEX player_weap_stats_2011Q4_ix01 on player_weapon_stats_2011Q4(create_dt);
60 CREATE INDEX player_weap_stats_2011Q4_ix02 on player_weapon_stats_2011Q4(game_id);
61 CREATE INDEX player_weap_stats_2011Q4_ix03 on player_weapon_stats_2011Q4(player_id);
62 ALTER TABLE xonstat.player_weapon_stats_2011Q4 OWNER TO xonstat;
64 CREATE TABLE xonstat.player_weapon_stats_2012Q1 (
65 CHECK ( create_dt >= DATE '2012-01-01' AND create_dt < DATE '2012-04-01' )
66 ) INHERITS (player_weapon_stats);
68 CREATE INDEX player_weap_stats_2012Q1_ix01 on player_weapon_stats_2012Q1(create_dt);
69 CREATE INDEX player_weap_stats_2012Q1_ix02 on player_weapon_stats_2012Q1(game_id);
70 CREATE INDEX player_weap_stats_2012Q1_ix03 on player_weapon_stats_2012Q1(player_id);
71 ALTER TABLE xonstat.player_weapon_stats_2012Q1 OWNER TO xonstat;
73 CREATE TABLE xonstat.player_weapon_stats_2012Q2 (
74 CHECK ( create_dt >= DATE '2012-04-01' AND create_dt < DATE '2012-07-01' )
75 ) INHERITS (player_weapon_stats);
77 CREATE INDEX player_weap_stats_2012Q2_ix01 on player_weapon_stats_2012Q2(create_dt);
78 CREATE INDEX player_weap_stats_2012Q2_ix02 on player_weapon_stats_2012Q2(game_id);
79 CREATE INDEX player_weap_stats_2012Q2_ix03 on player_weapon_stats_2012Q2(player_id);
80 ALTER TABLE xonstat.player_weapon_stats_2012Q2 OWNER TO xonstat;
82 CREATE TABLE xonstat.player_weapon_stats_2012Q3 (
83 CHECK ( create_dt >= DATE '2012-07-01' AND create_dt < DATE '2012-10-01' )
84 ) INHERITS (player_weapon_stats);
86 CREATE INDEX player_weap_stats_2012Q3_ix01 on player_weapon_stats_2012Q3(create_dt);
87 CREATE INDEX player_weap_stats_2012Q3_ix02 on player_weapon_stats_2012Q3(game_id);
88 CREATE INDEX player_weap_stats_2012Q3_ix03 on player_weapon_stats_2012Q3(player_id);
89 ALTER TABLE xonstat.player_weapon_stats_2012Q3 OWNER TO xonstat;
91 CREATE TABLE xonstat.player_weapon_stats_2012Q4 (
92 CHECK ( create_dt >= DATE '2012-10-01' AND create_dt < DATE '2013-01-01' )
93 ) INHERITS (player_weapon_stats);
95 CREATE INDEX player_weap_stats_2012Q4_ix01 on player_weapon_stats_2012Q4(create_dt);
96 CREATE INDEX player_weap_stats_2012Q4_ix02 on player_weapon_stats_2012Q4(game_id);
97 CREATE INDEX player_weap_stats_2012Q4_ix03 on player_weapon_stats_2012Q4(player_id);
98 ALTER TABLE xonstat.player_weapon_stats_2012Q4 OWNER TO xonstat;
100 CREATE TABLE xonstat.player_weapon_stats_2013Q1 (
101 CHECK ( create_dt >= DATE '2013-01-01' AND create_dt < DATE '2013-04-01' )
102 ) INHERITS (player_weapon_stats);
104 CREATE INDEX player_weap_stats_2013Q1_ix01 on player_weapon_stats_2013Q1(create_dt);
105 CREATE INDEX player_weap_stats_2013Q1_ix02 on player_weapon_stats_2013Q1(game_id);
106 CREATE INDEX player_weap_stats_2013Q1_ix03 on player_weapon_stats_2013Q1(player_id);
107 ALTER TABLE xonstat.player_weapon_stats_2013Q1 OWNER TO xonstat;
109 CREATE TABLE xonstat.player_weapon_stats_2013Q2 (
110 CHECK ( create_dt >= DATE '2013-04-01' AND create_dt < DATE '2013-07-01' )
111 ) INHERITS (player_weapon_stats);
113 CREATE INDEX player_weap_stats_2013Q2_ix01 on player_weapon_stats_2013Q2(create_dt);
114 CREATE INDEX player_weap_stats_2013Q2_ix02 on player_weapon_stats_2013Q2(game_id);
115 CREATE INDEX player_weap_stats_2013Q2_ix03 on player_weapon_stats_2013Q2(player_id);
116 ALTER TABLE xonstat.player_weapon_stats_2013Q2 OWNER TO xonstat;