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,
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
26 CREATE INDEX games_ix001 on games(create_dt);
27 ALTER TABLE xonstat.games OWNER TO xonstat;
29 CREATE TABLE xonstat.games_2011Q2 (
30 CHECK ( create_dt >= DATE '2011-04-01' AND create_dt < DATE '2011-07-01' )
32 CREATE INDEX games_2011Q2_ix001 on games_2011Q2(create_dt);
33 ALTER TABLE xonstat.games_2011Q2 OWNER TO xonstat;
35 CREATE TABLE xonstat.games_2011Q3 (
36 CHECK ( create_dt >= DATE '2011-07-01' AND create_dt < DATE '2011-10-01' )
38 CREATE INDEX games_2011Q3_ix001 on games_2011Q3(create_dt);
39 ALTER TABLE xonstat.games_2011Q3 OWNER TO xonstat;
41 CREATE TABLE xonstat.games_2011Q4 (
42 CHECK ( create_dt >= DATE '2011-10-01' AND create_dt < DATE '2012-01-01' )
44 CREATE INDEX games_2011Q4_ix001 on games_2011Q4(create_dt);
45 ALTER TABLE xonstat.games_2011Q4 OWNER TO xonstat;
47 CREATE TABLE xonstat.games_2012Q1 (
48 CHECK ( create_dt >= DATE '2012-01-01' AND create_dt < DATE '2012-04-01' )
50 CREATE INDEX games_2012Q1_ix001 on games_2012Q1(create_dt);
51 ALTER TABLE xonstat.games_2012Q1 OWNER TO xonstat;
53 CREATE TABLE xonstat.games_2012Q2 (
54 CHECK ( create_dt >= DATE '2012-04-01' AND create_dt < DATE '2012-07-01' )
56 CREATE INDEX games_2012Q2_ix001 on games_2012Q2(create_dt);
57 ALTER TABLE xonstat.games_2012Q2 OWNER TO xonstat;
59 CREATE TABLE xonstat.games_2012Q3 (
60 CHECK ( create_dt >= DATE '2012-07-01' AND create_dt < DATE '2012-10-01' )
62 CREATE INDEX games_2012Q3_ix001 on games_2012Q3(create_dt);
63 ALTER TABLE xonstat.games_2012Q3 OWNER TO xonstat;
65 CREATE TABLE xonstat.games_2012Q4 (
66 CHECK ( create_dt >= DATE '2012-10-01' AND create_dt < DATE '2013-01-01' )
68 CREATE INDEX games_2012Q4_ix001 on games_2012Q4(create_dt);
69 ALTER TABLE xonstat.games_2012Q4 OWNER TO xonstat;
71 CREATE TABLE xonstat.games_2013Q1 (
72 CHECK ( create_dt >= DATE '2013-01-01' AND create_dt < DATE '2013-04-01' )
74 CREATE INDEX games_2013Q1_ix001 on games_2013Q1(create_dt);
75 ALTER TABLE xonstat.games_2013Q1 OWNER TO xonstat;
77 CREATE TABLE xonstat.games_2013Q2 (
78 CHECK ( create_dt >= DATE '2013-04-01' AND create_dt < DATE '2013-07-01' )
80 CREATE INDEX games_2013Q2_ix001 on games_2013Q2(create_dt);
81 ALTER TABLE xonstat.games_2013Q2 OWNER TO xonstat;