From c448ab4a52bc64a0d73f9a0b02943267ee9c722d Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 13 Oct 2020 20:42:15 +0200 Subject: [PATCH] Use datetime with TZ for posts timestamps Signed-off-by: Thomas Citharel --- lib/graphql/schema/post.ex | 4 ++-- lib/mobilizon/posts/post.ex | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/graphql/schema/post.ex b/lib/graphql/schema/post.ex index 5057d08b4..a273dd837 100644 --- a/lib/graphql/schema/post.ex +++ b/lib/graphql/schema/post.ex @@ -17,8 +17,8 @@ defmodule Mobilizon.GraphQL.Schema.PostType do field(:attributed_to, :actor, description: "The post's group") field(:visibility, :post_visibility, description: "The post's visibility") field(:publish_at, :datetime, description: "When the post was published") - field(:inserted_at, :naive_datetime, description: "The post's creation date") - field(:updated_at, :naive_datetime, description: "The post's last update date") + field(:inserted_at, :datetime, description: "The post's creation date") + field(:updated_at, :datetime, description: "The post's last update date") field(:tags, list_of(:tag), resolve: &Tag.list_tags_for_post/3, diff --git a/lib/mobilizon/posts/post.ex b/lib/mobilizon/posts/post.ex index 93439b568..cbd095f66 100644 --- a/lib/mobilizon/posts/post.ex +++ b/lib/mobilizon/posts/post.ex @@ -61,7 +61,7 @@ defmodule Mobilizon.Posts.Post do belongs_to(:picture, Picture, on_replace: :update) many_to_many(:tags, Tag, join_through: "posts_tags", on_replace: :delete) - timestamps() + timestamps(type: :utc_datetime) end @required_attrs [