]> git.rm.cloudns.org Git - xonotic/xonstatdb.git/commitdiff
Ensure that the hashkeys for player and server are unique, as they are used for lookup.
authorAnt Zucaro <azucaro@gmail.com>
Fri, 28 Oct 2011 00:33:43 +0000 (20:33 -0400)
committerAnt Zucaro <azucaro@gmail.com>
Fri, 28 Oct 2011 00:33:43 +0000 (20:33 -0400)
tables/hashkeys.tab
tables/server_hashkeys.tab

index 0240c902624d30535a7098d25774e50d7a26273f..3e869db6eb0467b8e6bd77d1268399cf3b22482d 100644 (file)
@@ -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
index f3d049ce50bdd15205843e614ed803d289a14153..b4c9297b420061774d50ca2c55a6a3396ab86578 100644 (file)
@@ -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