I forgot to add timestamps to one of my tables, so I created a new migration to do so:
defmodule Guardian.Repo.Migrations.AddTimestampsToCounties do
use Ecto.Migration
def change do
alter table(:counties) do
timestamps([type: :utc_datetime_usec])
end
end
end
This works fine locally, but the inserted_at and updated_at field are not being added to the database in production on Fly.io.
The schema_migrations table showed the migration was up too, but the two fields were not in the database. I couldn’t get it to work, so I deleted the app and re-deployed it and it worked fine that time. Definitely not a procedure I want to have to do going forward though.
Yah, that is definitely super-duper odd. I’ve had migrations be in a half-finished state, but this one is perplexing since it said it finished but didn’t do what it said it should have done. I wonder if a rollback followed by migration would have fixed it.