]> de.git.xonotic.org Git - xonotic/xonstatdb.git/blob - tables/player_map_captimes.tab
Merge branch 'frag-matrix'
[xonotic/xonstatdb.git] / tables / player_map_captimes.tab
1 CREATE TABLE xonstat.player_map_captimes
2 (
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   mod character varying(64),
9   create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'),
10   CONSTRAINT player_map_captimes_pk PRIMARY KEY (player_map_captime_id),
11   CONSTRAINT player_map_captimes_uk01 UNIQUE (player_id, map_id, mod),
12   CONSTRAINT player_map_captimes_fk01 FOREIGN KEY (player_id)
13       REFERENCES xonstat.players (player_id) MATCH SIMPLE
14       ON UPDATE NO ACTION ON DELETE NO ACTION,
15   CONSTRAINT player_map_captimes_fk02 FOREIGN KEY (map_id)
16       REFERENCES xonstat.maps (map_id) MATCH SIMPLE
17       ON UPDATE NO ACTION ON DELETE NO ACTION
18 -- I have no idea why this causes an integrity constraint error,
19 -- but it does. Since it is not critical, I'll drop it off for now,
20 -- until I get a clue as to why the error happens.
21 -- ,
22  -- CONSTRAINT player_map_captimes_fk03 FOREIGN KEY (game_id)
23       -- REFERENCES xonstat.games (game_id) MATCH SIMPLE
24       -- ON UPDATE NO ACTION ON DELETE NO ACTION
25 )
26 WITH (
27   OIDS=FALSE
28 );
29 ALTER TABLE xonstat.player_map_captimes OWNER TO xonstat;