]> de.git.xonotic.org Git - xonotic/xonstatdb.git/blobdiff - tables/hashkeys.tab
Support deactivating players.
[xonotic/xonstatdb.git] / tables / hashkeys.tab
index 0240c902624d30535a7098d25774e50d7a26273f..1f0243d5b4bcb079f575d7f6b570f46cf0d9a9d9 100644 (file)
@@ -3,11 +3,12 @@ CREATE TABLE xonstat.hashkeys
   player_id integer NOT NULL,
   hashkey character varying(44) NOT NULL,
   active_ind boolean NOT NULL DEFAULT true,
-  create_dt timestamp without time zone NOT NULL DEFAULT now(),
+  create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'),
   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