TL;DR, ActiveRecord's timestamps macro creates :created_at and :updated_at but Ecto's timestamps creates :inserted_at and :updated_at. If you already have a database setup and now want to switch from ActiveRecord rails to Ecto Elixir, you'll no doubt run into the following error:
(1054): Unknown column 'a0.inserted_at' in 'field list'
You can resolve this by going into your model file and making the following edit:
# models/appointments.ex
defmodule Appointment do
...
schema "appointments" do
...
timestamps inserted_at: :created_at
end
...
end
This way, Ecto knows your inserted_at is called created_at as per rails convention.