From d154435a00bee04223fd952393be657f9231a2f0 Mon Sep 17 00:00:00 2001 From: Jonni Liljamo Date: Fri, 17 Feb 2023 12:06:19 +0200 Subject: [PATCH] fix(api): timestamp -> timestamptz --- api/migrations/2023-02-17-075706_create_users/up.sql | 4 ++-- api/migrations/2023-02-17-085226_create_gamedata/up.sql | 4 ++-- api/migrations/2023-02-17-085421_create_actions/up.sql | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/api/migrations/2023-02-17-075706_create_users/up.sql b/api/migrations/2023-02-17-075706_create_users/up.sql index 0ed10ff..a5d9a9c 100644 --- a/api/migrations/2023-02-17-075706_create_users/up.sql +++ b/api/migrations/2023-02-17-075706_create_users/up.sql @@ -2,8 +2,8 @@ CREATE TABLE users ( id uuid PRIMARY KEY NOT NULL DEFAULT gen_random_uuid(), - created_at TIMESTAMP NOT NULL DEFAULT current_timestamp, - updated_at TIMESTAMP NOT NULL DEFAULT current_timestamp, + created_at TIMESTAMPTZ NOT NULL DEFAULT current_timestamp, + updated_at TIMESTAMPTZ NOT NULL DEFAULT current_timestamp, username VARCHAR NOT NULL, email VARCHAR NOT NULL, password VARCHAR NOT NULL diff --git a/api/migrations/2023-02-17-085226_create_gamedata/up.sql b/api/migrations/2023-02-17-085226_create_gamedata/up.sql index a764a0d..d1395a4 100644 --- a/api/migrations/2023-02-17-085226_create_gamedata/up.sql +++ b/api/migrations/2023-02-17-085226_create_gamedata/up.sql @@ -2,8 +2,8 @@ CREATE TABLE gamedata ( id uuid PRIMARY KEY NOT NULL DEFAULT gen_random_uuid(), - created_at TIMESTAMP NOT NULL DEFAULT current_timestamp, - updated_at TIMESTAMP NOT NULL DEFAULT current_timestamp, + created_at TIMESTAMPTZ NOT NULL DEFAULT current_timestamp, + updated_at TIMESTAMPTZ NOT NULL DEFAULT current_timestamp, turn SMALLINT NOT NULL, host_hand json, host_deck json, diff --git a/api/migrations/2023-02-17-085421_create_actions/up.sql b/api/migrations/2023-02-17-085421_create_actions/up.sql index cddb124..537167d 100644 --- a/api/migrations/2023-02-17-085421_create_actions/up.sql +++ b/api/migrations/2023-02-17-085421_create_actions/up.sql @@ -2,12 +2,12 @@ CREATE TABLE actions ( id uuid PRIMARY KEY NOT NULL DEFAULT gen_random_uuid(), - created_at TIMESTAMP NOT NULL DEFAULT current_timestamp, - updated_at TIMESTAMP NOT NULL DEFAULT current_timestamp, + created_at TIMESTAMPTZ NOT NULL DEFAULT current_timestamp, + updated_at TIMESTAMPTZ NOT NULL DEFAULT current_timestamp, game_data_id uuid REFERENCES gamedata(id) NOT NULL, invoker uuid REFERENCES users(id) NOT NULL, data json NOT NULL, - timestamp TIMESTAMP NOT NULL DEFAULT current_timestamp + timestamp TIMESTAMPTZ NOT NULL DEFAULT current_timestamp ); SELECT diesel_manage_updated_at('actions'); -- 2.44.1