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