]> de.git.xonotic.org Git - xonotic/xonstatdb.git/blobdiff - tables/hashkeys.tab
Use UTC timestamps instead of local timestamps.
[xonotic/xonstatdb.git] / tables / hashkeys.tab
index b39409ae38236493353b7a6fe1c53319e45faf1a..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 with 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