From 9aad421c3a0bb04cde9e8adbb62e5865f63f171a Mon Sep 17 00:00:00 2001 From: Ant Zucaro Date: Thu, 27 Oct 2011 20:33:43 -0400 Subject: [PATCH] Ensure that the hashkeys for player and server are unique, as they are used for lookup. --- tables/hashkeys.tab | 3 ++- tables/server_hashkeys.tab | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) 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 -- 2.39.2