diff --git a/db/migrate/20260426061518_add_map_url_to_schedule_items.rb b/db/migrate/20260426061518_add_map_url_to_schedule_items.rb index c709c38..cb4bc43 100644 --- a/db/migrate/20260426061518_add_map_url_to_schedule_items.rb +++ b/db/migrate/20260426061518_add_map_url_to_schedule_items.rb @@ -1,5 +1,10 @@ class AddMapUrlToScheduleItems < ActiveRecord::Migration[8.1] def change - add_column :schedule_items, :map_url, :string + # Idempotent: production database already has this column from a prior + # schema:load, but `schema_migrations` did not record this version, which + # caused a deploy crash loop (PG::DuplicateColumn). `if_not_exists` lets + # the migration succeed in that drifted state so Rails records the version + # and future deploys are clean. + add_column :schedule_items, :map_url, :string, if_not_exists: true end end