I was looking around in the ecto documentation and I could not find if is there a way to config ecto to use utc_datetime instead naive_datetime. I know that there is the option of setting the specific migration and schema, however I want this to be at project level.
I usually have my own Schema module that when I use it, it sets the schema attributes to avoid forgetting it on the actual schema modules… something like
defmodule MyApp.Schema do
def __using__(_opts) do
quote do
use Ecto.Schema
@primary_key {:id, :binary_id, autogenerate: true}
@foreign_key :binary_id
@timestamp_opts [type: :naive_datetime]
end
end
end