support prod ip db import

This commit is contained in:
Graham McIntire 2026-01-28 14:03:35 -06:00
parent 0b27300931
commit a4ea96bebc

View file

@ -88,10 +88,13 @@ defmodule ToweropsWeb.Api.V1.GeoipController do
end
defp import_batch("locations", data, truncate) do
alias Towerops.GeoIP.Block
alias Towerops.GeoIP.Location
alias Towerops.Repo
if truncate do
# Must delete blocks first due to foreign key constraint
Repo.delete_all(Block)
Repo.delete_all(Location)
end