Fix timestamps to always create as :utc_datetime
.
This commit is contained in:
parent
8686112df7
commit
8f0a9a1e66
2 changed files with 7 additions and 5 deletions
|
@ -6,22 +6,22 @@
|
||||||
use Mix.Config
|
use Mix.Config
|
||||||
|
|
||||||
# General application configuration
|
# General application configuration
|
||||||
config :faces,
|
config :faces, ecto_repos: [Faces.Repo]
|
||||||
ecto_repos: [Faces.Repo]
|
|
||||||
|
|
||||||
# Configures the endpoint
|
# Configures the endpoint
|
||||||
config :faces, FacesWeb.Endpoint,
|
config :faces, FacesWeb.Endpoint,
|
||||||
url: [host: "localhost"],
|
url: [host: "localhost"],
|
||||||
secret_key_base: "ThLNldzPhX4I3g7eg79qoWrA1dj48zfsJBwbivAgNXq3XxhIo8tYh7jtteExdh0N",
|
secret_key_base: "ThLNldzPhX4I3g7eg79qoWrA1dj48zfsJBwbivAgNXq3XxhIo8tYh7jtteExdh0N",
|
||||||
render_errors: [view: FacesWeb.ErrorView, accepts: ~w(html json)],
|
render_errors: [view: FacesWeb.ErrorView, accepts: ~w(html json)],
|
||||||
pubsub: [name: Faces.PubSub,
|
pubsub: [name: Faces.PubSub, adapter: Phoenix.PubSub.PG2]
|
||||||
adapter: Phoenix.PubSub.PG2]
|
|
||||||
|
|
||||||
# Configures Elixir's Logger
|
# Configures Elixir's Logger
|
||||||
config :logger, :console,
|
config :logger, :console,
|
||||||
format: "$time $metadata[$level] $message\n",
|
format: "$time $metadata[$level] $message\n",
|
||||||
metadata: [:user_id]
|
metadata: [:user_id]
|
||||||
|
|
||||||
|
config :faces, Faces.Repo, migration_timestamps: [type: :utc_datetime]
|
||||||
|
|
||||||
# Import environment specific config. This must remain at the bottom
|
# Import environment specific config. This must remain at the bottom
|
||||||
# of this file so it overrides the configuration defined above.
|
# of this file so it overrides the configuration defined above.
|
||||||
import_config "#{Mix.env}.exs"
|
import_config "#{Mix.env()}.exs"
|
||||||
|
|
|
@ -2,6 +2,8 @@ defmodule Faces.Gallery.Person do
|
||||||
use Ecto.Schema
|
use Ecto.Schema
|
||||||
import Ecto.Changeset
|
import Ecto.Changeset
|
||||||
|
|
||||||
|
@timestamps_opts [type: :utc_datetime, usec: true]
|
||||||
|
|
||||||
schema "people" do
|
schema "people" do
|
||||||
field(:username, :string)
|
field(:username, :string)
|
||||||
field(:avatar_url, :string)
|
field(:avatar_url, :string)
|
||||||
|
|
Reference in a new issue