]> de.git.xonotic.org Git - xonotic/xonstatdb.git/blobdiff - tables/games.tab
Fix unique key definition on games.
[xonotic/xonstatdb.git] / tables / games.tab
old mode 100644 (file)
new mode 100755 (executable)
index e26ba1d..2d8a4a5
@@ -7,7 +7,7 @@ CREATE TABLE xonstat.games
   map_id integer NOT NULL,
   duration interval,
   winner integer,
-  match_id numeric,
+  match_id character varying(64),
   create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'),
   CONSTRAINT games_pk PRIMARY KEY (game_id),
   CONSTRAINT games_fk001 FOREIGN KEY (game_type_cd)
@@ -18,7 +18,8 @@ CREATE TABLE xonstat.games
       ON UPDATE NO ACTION ON DELETE NO ACTION,
   CONSTRAINT games_fk003 FOREIGN KEY (map_id)
       REFERENCES xonstat.maps (map_id) MATCH SIMPLE
-      ON UPDATE NO ACTION ON DELETE NO ACTION
+      ON UPDATE NO ACTION ON DELETE NO ACTION,
+  CONSTRAINT games_uk001 UNIQUE (server_id, match_id)
 )
 WITH (
   OIDS=FALSE