From 75f5b39c54ab9d7a5f118aa4de1c1d0bb76626d1 Mon Sep 17 00:00:00 2001 From: Ant Zucaro Date: Wed, 16 Nov 2011 15:22:49 -0500 Subject: [PATCH] Use UTC timestamps instead of local timestamps. --- tables/achievements.tab | 2 +- tables/db_version.tab | 2 +- tables/games.tab | 2 +- tables/hashkeys.tab | 2 +- tables/maps.tab | 1 + tables/player_nicks.tab | 2 +- tables/player_weapon_stats.tab | 2 +- tables/players.tab | 2 +- tables/servers.tab | 2 +- 9 files changed, 9 insertions(+), 8 deletions(-) mode change 100644 => 100755 tables/maps.tab diff --git a/tables/achievements.tab b/tables/achievements.tab index a5006a4..139e777 100644 --- a/tables/achievements.tab +++ b/tables/achievements.tab @@ -3,7 +3,7 @@ CREATE TABLE xonstat.achievements achievement_id serial NOT NULL, achievement_cd integer NOT NULL, player_id integer NOT NULL, - 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 achievements_pk PRIMARY KEY (achievement_id), CONSTRAINT achievements_fk001 FOREIGN KEY (achievement_cd) REFERENCES xonstat.cd_achievement (achievement_cd) MATCH SIMPLE diff --git a/tables/db_version.tab b/tables/db_version.tab index 90d8955..967fcc6 100644 --- a/tables/db_version.tab +++ b/tables/db_version.tab @@ -2,7 +2,7 @@ CREATE TABLE xonstat.db_version ( "version" character varying(15) NOT NULL, descr character varying(100) NOT NULL, - 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 db_version_pk PRIMARY KEY (version) ) WITH ( diff --git a/tables/games.tab b/tables/games.tab index c2e3056..fe76771 100644 --- a/tables/games.tab +++ b/tables/games.tab @@ -7,7 +7,7 @@ CREATE TABLE xonstat.games map_id integer NOT NULL, duration interval, winner integer, - 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 games_pk PRIMARY KEY (game_id), CONSTRAINT games_fk001 FOREIGN KEY (game_type_cd) REFERENCES xonstat.cd_game_type (game_type_cd) MATCH SIMPLE diff --git a/tables/hashkeys.tab b/tables/hashkeys.tab index 3e869db..1f0243d 100644 --- a/tables/hashkeys.tab +++ b/tables/hashkeys.tab @@ -3,7 +3,7 @@ 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 diff --git a/tables/maps.tab b/tables/maps.tab old mode 100644 new mode 100755 index dda0ff4..a186a4e --- a/tables/maps.tab +++ b/tables/maps.tab @@ -5,6 +5,7 @@ CREATE TABLE xonstat.maps "version" integer NOT NULL DEFAULT 1, pk3_name character varying(100), curl_url character varying(300), + create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'), CONSTRAINT maps_pk PRIMARY KEY (map_id) ) WITH ( diff --git a/tables/player_nicks.tab b/tables/player_nicks.tab index d80c8dd..6a42088 100644 --- a/tables/player_nicks.tab +++ b/tables/player_nicks.tab @@ -3,7 +3,7 @@ CREATE TABLE xonstat.player_nicks player_id integer NOT NULL, stripped_nick character varying(128) NOT NULL, nick character varying(128) NOT NULL, - 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 player_nicks_pk PRIMARY KEY (player_id, stripped_nick), CONSTRAINT player_nicks_fk01 FOREIGN KEY (player_id) REFERENCES xonstat.players (player_id) MATCH SIMPLE diff --git a/tables/player_weapon_stats.tab b/tables/player_weapon_stats.tab index 2968a89..60954bb 100644 --- a/tables/player_weapon_stats.tab +++ b/tables/player_weapon_stats.tab @@ -10,7 +10,7 @@ CREATE TABLE xonstat.player_weapon_stats hit integer NOT NULL default 0, fired integer NOT NULL default 0, frags integer NOT NULL default 0, - 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 player_weapon_stats_pk PRIMARY KEY (player_weapon_stats_id), CONSTRAINT player_weapon_stats_fk001 FOREIGN KEY (player_id) REFERENCES xonstat.players (player_id) MATCH SIMPLE diff --git a/tables/players.tab b/tables/players.tab index b51fb33..b75a53a 100644 --- a/tables/players.tab +++ b/tables/players.tab @@ -4,7 +4,7 @@ CREATE TABLE xonstat.players nick character varying(128), stripped_nick character varying(128), "location" character varying(100), - 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 players_pk PRIMARY KEY (player_id) ) WITH ( diff --git a/tables/servers.tab b/tables/servers.tab index 0bc4bba..fe3881e 100644 --- a/tables/servers.tab +++ b/tables/servers.tab @@ -9,7 +9,7 @@ CREATE TABLE xonstat.servers revision character varying(50), pure_ind boolean NOT NULL DEFAULT true, 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 servers_pk PRIMARY KEY (server_id) ) WITH ( -- 2.39.2