]> 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 6d7fd88139d37b04518229223a3fa69f747632a0..1f0243d5b4bcb079f575d7f6b570f46cf0d9a9d9 100644 (file)
@@ -1,13 +1,14 @@
 CREATE TABLE xonstat.hashkeys
 (
-  player_id serial NOT NULL,
+  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