Skip to content

Commit

Permalink
fix: Run database migrations before starting anything else
Browse files Browse the repository at this point in the history
This allows us to put migrations and code that relies on those
migrations into the same commits.

If the code relies on changes made in a migration, and the migration
runs after the code starts, then there's a potential race condition
where that code runs before the migrations have run, which would cause
an error. This eliminates that possibility.
  • Loading branch information
joshlarson committed Aug 5, 2024
1 parent 0f120e8 commit 329d71e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/skate/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ defmodule Skate.Application do
[]
end ++
[
Skate.Migrate,
{Phoenix.PubSub, name: Skate.PubSub},
SkateWeb.Endpoint,
Skate.Migrate,
{Oban, Application.fetch_env!(:skate, Oban)},
{Skate.Detours.TripModificationPublisher,
Application.get_env(:skate, Skate.Detours.TripModificationPublisher)}
Expand Down

0 comments on commit 329d71e

Please sign in to comment.