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 mod character varying(64),
12 create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'),
13 CONSTRAINT games_pk PRIMARY KEY (game_id),
14 CONSTRAINT games_fk001 FOREIGN KEY (game_type_cd)
15 REFERENCES xonstat.cd_game_type (game_type_cd) MATCH SIMPLE
16 ON UPDATE NO ACTION ON DELETE NO ACTION,
17 CONSTRAINT games_fk002 FOREIGN KEY (server_id)
18 REFERENCES xonstat.servers (server_id) MATCH SIMPLE
19 ON UPDATE NO ACTION ON DELETE NO ACTION,
20 CONSTRAINT games_fk003 FOREIGN KEY (map_id)
21 REFERENCES xonstat.maps (map_id) MATCH SIMPLE
22 ON UPDATE NO ACTION ON DELETE NO ACTION,
23 CONSTRAINT games_uk001 UNIQUE (server_id, match_id)
28 CREATE INDEX games_ix001 on games(create_dt);
29 ALTER TABLE xonstat.games OWNER TO xonstat;
32 CREATE TABLE xonstat.games_2011Q2 (
33 CHECK ( create_dt >= DATE '2011-04-01' AND create_dt < DATE '2011-07-01' )
35 CREATE INDEX games_2011Q2_ix001 on games_2011Q2(create_dt);
36 ALTER TABLE xonstat.games_2011Q2 OWNER TO xonstat;
38 CREATE TABLE xonstat.games_2011Q3 (
39 CHECK ( create_dt >= DATE '2011-07-01' AND create_dt < DATE '2011-10-01' )
41 CREATE INDEX games_2011Q3_ix001 on games_2011Q3(create_dt);
42 ALTER TABLE xonstat.games_2011Q3 OWNER TO xonstat;
44 CREATE TABLE xonstat.games_2011Q4 (
45 CHECK ( create_dt >= DATE '2011-10-01' AND create_dt < DATE '2012-01-01' )
47 CREATE INDEX games_2011Q4_ix001 on games_2011Q4(create_dt);
48 ALTER TABLE xonstat.games_2011Q4 OWNER TO xonstat;
51 CREATE TABLE xonstat.games_2012Q1 (
52 CHECK ( create_dt >= DATE '2012-01-01' AND create_dt < DATE '2012-04-01' )
54 CREATE INDEX games_2012Q1_ix001 on games_2012Q1(create_dt);
55 ALTER TABLE xonstat.games_2012Q1 OWNER TO xonstat;
57 CREATE TABLE xonstat.games_2012Q2 (
58 CHECK ( create_dt >= DATE '2012-04-01' AND create_dt < DATE '2012-07-01' )
60 CREATE INDEX games_2012Q2_ix001 on games_2012Q2(create_dt);
61 ALTER TABLE xonstat.games_2012Q2 OWNER TO xonstat;
63 CREATE TABLE xonstat.games_2012Q3 (
64 CHECK ( create_dt >= DATE '2012-07-01' AND create_dt < DATE '2012-10-01' )
66 CREATE INDEX games_2012Q3_ix001 on games_2012Q3(create_dt);
67 ALTER TABLE xonstat.games_2012Q3 OWNER TO xonstat;
69 CREATE TABLE xonstat.games_2012Q4 (
70 CHECK ( create_dt >= DATE '2012-10-01' AND create_dt < DATE '2013-01-01' )
72 CREATE INDEX games_2012Q4_ix001 on games_2012Q4(create_dt);
73 ALTER TABLE xonstat.games_2012Q4 OWNER TO xonstat;
76 CREATE TABLE xonstat.games_2013Q1 (
77 CHECK ( create_dt >= DATE '2013-01-01' AND create_dt < DATE '2013-04-01' )
79 CREATE INDEX games_2013Q1_ix001 on games_2013Q1(create_dt);
80 ALTER TABLE xonstat.games_2013Q1 OWNER TO xonstat;
82 CREATE TABLE xonstat.games_2013Q2 (
83 CHECK ( create_dt >= DATE '2013-04-01' AND create_dt < DATE '2013-07-01' )
85 CREATE INDEX games_2013Q2_ix001 on games_2013Q2(create_dt);
86 ALTER TABLE xonstat.games_2013Q2 OWNER TO xonstat;
88 CREATE TABLE xonstat.games_2013Q3 (
89 CHECK ( create_dt >= DATE '2013-07-01' AND create_dt < DATE '2013-10-01' )
91 CREATE INDEX games_2013Q3_ix001 on games_2013Q3(create_dt);
92 ALTER TABLE xonstat.games_2013Q3 OWNER TO xonstat;
94 CREATE TABLE xonstat.games_2013Q4 (
95 CHECK ( create_dt >= DATE '2013-10-01' AND create_dt < DATE '2014-01-01' )
97 CREATE INDEX games_2013Q4_ix001 on games_2013Q4(create_dt);
98 ALTER TABLE xonstat.games_2013Q4 OWNER TO xonstat;
101 CREATE TABLE xonstat.games_2014Q1 (
102 CHECK ( create_dt >= DATE '2014-01-01' AND create_dt < DATE '2014-04-01' )
104 CREATE INDEX games_2014Q1_ix001 on games_2014Q1(create_dt);
105 ALTER TABLE xonstat.games_2014Q1 OWNER TO xonstat;
107 CREATE TABLE xonstat.games_2014Q2 (
108 CHECK ( create_dt >= DATE '2014-04-01' AND create_dt < DATE '2014-07-01' )
110 CREATE INDEX games_2014Q2_ix001 on games_2014Q2(create_dt);
111 ALTER TABLE xonstat.games_2014Q2 OWNER TO xonstat;
113 CREATE TABLE xonstat.games_2014Q3 (
114 CHECK ( create_dt >= DATE '2014-07-01' AND create_dt < DATE '2014-10-01' )
116 CREATE INDEX games_2014Q3_ix001 on games_2014Q3(create_dt);
117 ALTER TABLE xonstat.games_2014Q3 OWNER TO xonstat;
119 CREATE TABLE xonstat.games_2014Q4 (
120 CHECK ( create_dt >= DATE '2014-10-01' AND create_dt < DATE '2014-01-01' )
122 CREATE INDEX games_2014Q4_ix001 on games_2014Q4(create_dt);
123 ALTER TABLE xonstat.games_2014Q4 OWNER TO xonstat;