]> de.git.xonotic.org Git - xonotic/xonstatdb.git/blob - tables/player_weapon_stats.tab
86707536ebdbdddda9f591747ec2de79a092b7dc
[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 (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
27 )
28 WITH (
29   OIDS=FALSE
30 );
31
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
36 ALTER TABLE xonstat.player_weapon_stats OWNER TO xonstat;
37
38 CREATE TABLE xonstat.player_weapon_stats_2011Q2 (
39     CHECK ( create_dt >= DATE '2011-04-01' AND create_dt < DATE '2011-07-01' ) 
40 ) INHERITS (player_weapon_stats);
41
42 CREATE INDEX player_weap_stats_2011Q2_ix01 on player_weapon_stats_2011Q2(create_dt);
43 CREATE INDEX player_weap_stats_2011Q2_ix02 on player_weapon_stats_2011Q2(game_id);
44 CREATE INDEX player_weap_stats_2011Q2_ix03 on player_weapon_stats_2011Q2(player_id);
45 ALTER TABLE xonstat.player_weapon_stats_2011Q2 OWNER TO xonstat;
46
47 CREATE TABLE xonstat.player_weapon_stats_2011Q3 ( 
48     CHECK ( create_dt >= DATE '2011-07-01' AND create_dt < DATE '2011-10-01' ) 
49 ) INHERITS (player_weapon_stats);
50
51 CREATE INDEX player_weap_stats_2011Q3_ix01 on player_weapon_stats_2011Q3(create_dt);
52 CREATE INDEX player_weap_stats_2011Q3_ix02 on player_weapon_stats_2011Q3(game_id);
53 CREATE INDEX player_weap_stats_2011Q3_ix03 on player_weapon_stats_2011Q3(player_id);
54 ALTER TABLE xonstat.player_weapon_stats_2011Q3 OWNER TO xonstat;
55
56 CREATE TABLE xonstat.player_weapon_stats_2011Q4 ( 
57     CHECK ( create_dt >= DATE '2011-10-01' AND create_dt < DATE '2012-01-01' ) 
58 ) INHERITS (player_weapon_stats);
59
60 CREATE INDEX player_weap_stats_2011Q4_ix01 on player_weapon_stats_2011Q4(create_dt);
61 CREATE INDEX player_weap_stats_2011Q4_ix02 on player_weapon_stats_2011Q4(game_id);
62 CREATE INDEX player_weap_stats_2011Q4_ix03 on player_weapon_stats_2011Q4(player_id);
63 ALTER TABLE xonstat.player_weapon_stats_2011Q4 OWNER TO xonstat;
64
65 CREATE TABLE xonstat.player_weapon_stats_2012Q1 ( 
66     CHECK ( create_dt >= DATE '2012-01-01' AND create_dt < DATE '2012-04-01' ) 
67 ) INHERITS (player_weapon_stats);
68
69 CREATE INDEX player_weap_stats_2012Q1_ix01 on player_weapon_stats_2012Q1(create_dt);
70 CREATE INDEX player_weap_stats_2012Q1_ix02 on player_weapon_stats_2012Q1(game_id);
71 CREATE INDEX player_weap_stats_2012Q1_ix03 on player_weapon_stats_2012Q1(player_id);
72 ALTER TABLE xonstat.player_weapon_stats_2012Q1 OWNER TO xonstat;
73
74 CREATE TABLE xonstat.player_weapon_stats_2012Q2 ( 
75     CHECK ( create_dt >= DATE '2012-04-01' AND create_dt < DATE '2012-07-01' ) 
76 ) INHERITS (player_weapon_stats);
77
78 CREATE INDEX player_weap_stats_2012Q2_ix01 on player_weapon_stats_2012Q2(create_dt);
79 CREATE INDEX player_weap_stats_2012Q2_ix02 on player_weapon_stats_2012Q2(game_id);
80 CREATE INDEX player_weap_stats_2012Q2_ix03 on player_weapon_stats_2012Q2(player_id);
81 ALTER TABLE xonstat.player_weapon_stats_2012Q2 OWNER TO xonstat;
82
83 CREATE TABLE xonstat.player_weapon_stats_2012Q3 ( 
84     CHECK ( create_dt >= DATE '2012-07-01' AND create_dt < DATE '2012-10-01' ) 
85 ) INHERITS (player_weapon_stats);
86
87 CREATE INDEX player_weap_stats_2012Q3_ix01 on player_weapon_stats_2012Q3(create_dt);
88 CREATE INDEX player_weap_stats_2012Q3_ix02 on player_weapon_stats_2012Q3(game_id);
89 CREATE INDEX player_weap_stats_2012Q3_ix03 on player_weapon_stats_2012Q3(player_id);
90 ALTER TABLE xonstat.player_weapon_stats_2012Q3 OWNER TO xonstat;
91
92 CREATE TABLE xonstat.player_weapon_stats_2012Q4 ( 
93     CHECK ( create_dt >= DATE '2012-10-01' AND create_dt < DATE '2013-01-01' ) 
94 ) INHERITS (player_weapon_stats);
95
96 CREATE INDEX player_weap_stats_2012Q4_ix01 on player_weapon_stats_2012Q4(create_dt);
97 CREATE INDEX player_weap_stats_2012Q4_ix02 on player_weapon_stats_2012Q4(game_id);
98 CREATE INDEX player_weap_stats_2012Q4_ix03 on player_weapon_stats_2012Q4(player_id);
99 ALTER TABLE xonstat.player_weapon_stats_2012Q4 OWNER TO xonstat;
100
101 CREATE TABLE xonstat.player_weapon_stats_2013Q1 ( 
102     CHECK ( create_dt >= DATE '2013-01-01' AND create_dt < DATE '2013-04-01' ) 
103 ) INHERITS (player_weapon_stats);
104
105 CREATE INDEX player_weap_stats_2013Q1_ix01 on player_weapon_stats_2013Q1(create_dt);
106 CREATE INDEX player_weap_stats_2013Q1_ix02 on player_weapon_stats_2013Q1(game_id);
107 CREATE INDEX player_weap_stats_2013Q1_ix03 on player_weapon_stats_2013Q1(player_id);
108 ALTER TABLE xonstat.player_weapon_stats_2013Q1 OWNER TO xonstat;
109
110 CREATE TABLE xonstat.player_weapon_stats_2013Q2 ( 
111     CHECK ( create_dt >= DATE '2013-04-01' AND create_dt < DATE '2013-07-01' ) 
112 ) INHERITS (player_weapon_stats);
113
114 CREATE INDEX player_weap_stats_2013Q2_ix01 on player_weapon_stats_2013Q2(create_dt);
115 CREATE INDEX player_weap_stats_2013Q2_ix02 on player_weapon_stats_2013Q2(game_id);
116 CREATE INDEX player_weap_stats_2013Q2_ix03 on player_weapon_stats_2013Q2(player_id);
117 ALTER TABLE xonstat.player_weapon_stats_2013Q2 OWNER TO xonstat;