1 CREATE TABLE xonstat.games
3 game_id bigserial NOT NULL,
4 start_dt timestamp without time zone NOT NULL,
5 game_type_cd character varying(10) NOT NULL,
6 server_id integer NOT NULL,
7 map_id integer NOT NULL,
10 match_id character varying(64),
11 create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'),
12 CONSTRAINT games_pk PRIMARY KEY (game_id),
13 CONSTRAINT games_fk001 FOREIGN KEY (game_type_cd)
14 REFERENCES xonstat.cd_game_type (game_type_cd) MATCH SIMPLE
15 ON UPDATE NO ACTION ON DELETE NO ACTION,
16 CONSTRAINT games_fk002 FOREIGN KEY (server_id)
17 REFERENCES xonstat.servers (server_id) MATCH SIMPLE
18 ON UPDATE NO ACTION ON DELETE NO ACTION,
19 CONSTRAINT games_fk003 FOREIGN KEY (map_id)
20 REFERENCES xonstat.maps (map_id) MATCH SIMPLE
21 ON UPDATE NO ACTION ON DELETE NO ACTION,
22 CONSTRAINT games_uk001 UNIQUE KEY (server_id, match_id)
27 CREATE INDEX games_ix001 on games(create_dt);
28 ALTER TABLE xonstat.games OWNER TO xonstat;
30 CREATE TABLE xonstat.games_2011Q2 (
31 CHECK ( create_dt >= DATE '2011-04-01' AND create_dt < DATE '2011-07-01' )
33 CREATE INDEX games_2011Q2_ix001 on games_2011Q2(create_dt);
34 ALTER TABLE xonstat.games_2011Q2 OWNER TO xonstat;
36 CREATE TABLE xonstat.games_2011Q3 (
37 CHECK ( create_dt >= DATE '2011-07-01' AND create_dt < DATE '2011-10-01' )
39 CREATE INDEX games_2011Q3_ix001 on games_2011Q3(create_dt);
40 ALTER TABLE xonstat.games_2011Q3 OWNER TO xonstat;
42 CREATE TABLE xonstat.games_2011Q4 (
43 CHECK ( create_dt >= DATE '2011-10-01' AND create_dt < DATE '2012-01-01' )
45 CREATE INDEX games_2011Q4_ix001 on games_2011Q4(create_dt);
46 ALTER TABLE xonstat.games_2011Q4 OWNER TO xonstat;
48 CREATE TABLE xonstat.games_2012Q1 (
49 CHECK ( create_dt >= DATE '2012-01-01' AND create_dt < DATE '2012-04-01' )
51 CREATE INDEX games_2012Q1_ix001 on games_2012Q1(create_dt);
52 ALTER TABLE xonstat.games_2012Q1 OWNER TO xonstat;
54 CREATE TABLE xonstat.games_2012Q2 (
55 CHECK ( create_dt >= DATE '2012-04-01' AND create_dt < DATE '2012-07-01' )
57 CREATE INDEX games_2012Q2_ix001 on games_2012Q2(create_dt);
58 ALTER TABLE xonstat.games_2012Q2 OWNER TO xonstat;
60 CREATE TABLE xonstat.games_2012Q3 (
61 CHECK ( create_dt >= DATE '2012-07-01' AND create_dt < DATE '2012-10-01' )
63 CREATE INDEX games_2012Q3_ix001 on games_2012Q3(create_dt);
64 ALTER TABLE xonstat.games_2012Q3 OWNER TO xonstat;
66 CREATE TABLE xonstat.games_2012Q4 (
67 CHECK ( create_dt >= DATE '2012-10-01' AND create_dt < DATE '2013-01-01' )
69 CREATE INDEX games_2012Q4_ix001 on games_2012Q4(create_dt);
70 ALTER TABLE xonstat.games_2012Q4 OWNER TO xonstat;
72 CREATE TABLE xonstat.games_2013Q1 (
73 CHECK ( create_dt >= DATE '2013-01-01' AND create_dt < DATE '2013-04-01' )
75 CREATE INDEX games_2013Q1_ix001 on games_2013Q1(create_dt);
76 ALTER TABLE xonstat.games_2013Q1 OWNER TO xonstat;
78 CREATE TABLE xonstat.games_2013Q2 (
79 CHECK ( create_dt >= DATE '2013-04-01' AND create_dt < DATE '2013-07-01' )
81 CREATE INDEX games_2013Q2_ix001 on games_2013Q2(create_dt);
82 ALTER TABLE xonstat.games_2013Q2 OWNER TO xonstat;