1 CREATE TABLE xonstat.player_map_captimes
3 player_map_captime_id serial NOT NULL,
4 player_id integer NOT NULL,
5 map_id integer NOT NULL,
6 game_id bigint NOT NULL,
7 fastest_cap interval NOT NULL,
8 create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'),
9 CONSTRAINT player_map_captimes_pk PRIMARY KEY (player_map_captime_id),
10 CONSTRAINT player_map_captimes_uk01 UNIQUE (player_id, map_id),
11 CONSTRAINT player_map_captimes_fk01 FOREIGN KEY (player_id)
12 REFERENCES xonstat.players (player_id) MATCH SIMPLE
13 ON UPDATE NO ACTION ON DELETE NO ACTION,
14 CONSTRAINT player_map_captimes_fk02 FOREIGN KEY (map_id)
15 REFERENCES xonstat.maps (map_id) MATCH SIMPLE
16 ON UPDATE NO ACTION ON DELETE NO ACTION
17 -- I have no idea why this causes an integrity constraint error,
18 -- but it does. Since it is not critical, I'll drop it off for now,
19 -- until I get a clue as to why the error happens.
21 -- CONSTRAINT player_map_captimes_fk03 FOREIGN KEY (game_id)
22 -- REFERENCES xonstat.games (game_id) MATCH SIMPLE
23 -- ON UPDATE NO ACTION ON DELETE NO ACTION
28 ALTER TABLE xonstat.player_map_captimes OWNER TO xonstat;