Closed InoMurko closed 4 years ago
To resolve this I think we need to push this timestamp setting down into the migration like so:
# apps/engine/priv/repo/migrations/20200422044422_create_transactions.exs
add :inserted_at, :naive_datetime, default: fragment("now() at time zone 'utc'")
add :updated_at, :naive_datetime, default: fragment("now() at time zone 'utc'")
time is ewww, fix where it's coming from
In order to properly track the life cycle of our transaction, the timestamp in this particular location needs to come from the DB(Postgres) itself and NOT elixir. This requires us to ensure that the field being set at the DB level.
We need to update
Engine.DB.Transaction
(and other DB tables with timestamps) to: