]> de.git.xonotic.org Git - xonotic/xonstatdb.git/blob - tables/player_weapon_stats.tab
888b547613bbf809e68652806fd7c17aa8c3cbf4
[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   nick character varying(64),
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_uk001 UNIQUE (player_id, game_id, weapon_cd, nick)
25 )
26 WITH (
27   OIDS=FALSE
28 );
29 CREATE INDEX player_weap_stats_ix01 on player_weapon_stats(create_dt);
30 ALTER TABLE xonstat.player_weapon_stats OWNER TO xonstat;
31
32 CREATE TABLE xonstat.player_weapon_stats_2011Q2 (
33     CHECK ( create_dt >= DATE '2011-04-01' AND create_dt < DATE '2011-07-01' ) 
34 ) INHERITS (player_weapon_stats);
35 CREATE INDEX player_weap_stats_2011Q2_ix01 on player_weapon_stats_2011Q2(create_dt);
36 ALTER TABLE xonstat.player_weapon_stats_2011Q2 OWNER TO xonstat;
37
38 CREATE TABLE xonstat.player_weapon_stats_2011Q3 ( 
39     CHECK ( create_dt >= DATE '2011-07-01' AND create_dt < DATE '2011-10-01' ) 
40 ) INHERITS (player_weapon_stats);
41 CREATE INDEX player_weap_stats_2011Q3_ix01 on player_weapon_stats_2011Q3(create_dt);
42 ALTER TABLE xonstat.player_weapon_stats_2011Q3 OWNER TO xonstat;
43
44 CREATE TABLE xonstat.player_weapon_stats_2011Q4 ( 
45     CHECK ( create_dt >= DATE '2011-10-01' AND create_dt < DATE '2012-01-01' ) 
46 ) INHERITS (player_weapon_stats);
47 CREATE INDEX player_weap_stats_2011Q4_ix01 on player_weapon_stats_2011Q4(create_dt);
48 ALTER TABLE xonstat.player_weapon_stats_2011Q4 OWNER TO xonstat;
49
50 CREATE TABLE xonstat.player_weapon_stats_2012Q1 ( 
51     CHECK ( create_dt >= DATE '2012-01-01' AND create_dt < DATE '2012-04-01' ) 
52 ) INHERITS (player_weapon_stats);
53 CREATE INDEX player_weap_stats_2012Q1_ix01 on player_weapon_stats_2012Q1(create_dt);
54 ALTER TABLE xonstat.player_weapon_stats_2012Q1 OWNER TO xonstat;
55
56 CREATE TABLE xonstat.player_weapon_stats_2012Q2 ( 
57     CHECK ( create_dt >= DATE '2012-04-01' AND create_dt < DATE '2012-07-01' ) 
58 ) INHERITS (player_weapon_stats);
59 CREATE INDEX player_weap_stats_2012Q2_ix01 on player_weapon_stats_2012Q2(create_dt);
60 ALTER TABLE xonstat.player_weapon_stats_2012Q2 OWNER TO xonstat;
61
62 CREATE TABLE xonstat.player_weapon_stats_2012Q3 ( 
63     CHECK ( create_dt >= DATE '2012-07-01' AND create_dt < DATE '2012-10-01' ) 
64 ) INHERITS (player_weapon_stats);
65 CREATE INDEX player_weap_stats_2012Q3_ix01 on player_weapon_stats_2012Q3(create_dt);
66 ALTER TABLE xonstat.player_weapon_stats_2012Q3 OWNER TO xonstat;
67
68 CREATE TABLE xonstat.player_weapon_stats_2012Q4 ( 
69     CHECK ( create_dt >= DATE '2012-10-01' AND create_dt < DATE '2013-01-01' ) 
70 ) INHERITS (player_weapon_stats);
71 CREATE INDEX player_weap_stats_2012Q4_ix01 on player_weapon_stats_2012Q4(create_dt);
72 ALTER TABLE xonstat.player_weapon_stats_2012Q4 OWNER TO xonstat;
73
74 CREATE TABLE xonstat.player_weapon_stats_2013Q1 ( 
75     CHECK ( create_dt >= DATE '2013-01-01' AND create_dt < DATE '2013-04-01' ) 
76 ) INHERITS (player_weapon_stats);
77 CREATE INDEX player_weap_stats_2013Q1_ix01 on player_weapon_stats_2013Q1(create_dt);
78 ALTER TABLE xonstat.player_weapon_stats_2013Q1 OWNER TO xonstat;
79
80 CREATE TABLE xonstat.player_weapon_stats_2013Q2 ( 
81     CHECK ( create_dt >= DATE '2013-04-01' AND create_dt < DATE '2013-07-01' ) 
82 ) INHERITS (player_weapon_stats);
83 CREATE INDEX player_weap_stats_2013Q2_ix01 on player_weapon_stats_2013Q2(create_dt);
84 ALTER TABLE xonstat.player_weapon_stats_2013Q2 OWNER TO xonstat;