From: Ant Zucaro Date: Fri, 28 Oct 2011 00:33:43 +0000 (-0400) Subject: Ensure that the hashkeys for player and server are unique, as they are used for lookup. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9aad421c3a0bb04cde9e8adbb62e5865f63f171a;p=xonotic%2Fxonstatdb.git Ensure that the hashkeys for player and server are unique, as they are used for lookup. --- diff --git a/tables/hashkeys.tab b/tables/hashkeys.tab index 0240c90..3e869db 100644 --- a/tables/hashkeys.tab +++ b/tables/hashkeys.tab @@ -7,7 +7,8 @@ CREATE TABLE xonstat.hashkeys CONSTRAINT hashkeys_pk PRIMARY KEY (player_id, hashkey), CONSTRAINT hashkeys_fk001 FOREIGN KEY (player_id) REFERENCES xonstat.players (player_id) MATCH SIMPLE - ON UPDATE NO ACTION ON DELETE NO ACTION + ON UPDATE NO ACTION ON DELETE NO ACTION, + CONSTRAINT hashkeys_uk001 UNIQUE (hashkey) ) WITH ( OIDS=FALSE diff --git a/tables/server_hashkeys.tab b/tables/server_hashkeys.tab index f3d049c..b4c9297 100644 --- a/tables/server_hashkeys.tab +++ b/tables/server_hashkeys.tab @@ -7,7 +7,8 @@ CREATE TABLE xonstat.server_hashkeys CONSTRAINT server_hashkeys_pk PRIMARY KEY (server_id, hashkey), CONSTRAINT server_hashkeys_fk001 FOREIGN KEY (server_id) REFERENCES xonstat.servers (server_id) MATCH SIMPLE - ON UPDATE NO ACTION ON DELETE NO ACTION + ON UPDATE NO ACTION ON DELETE NO ACTION, + CONSTRAINT server_hashkeys_uk001 UNIQUE (hashkey) ) WITH ( OIDS=FALSE