support prod ip db import
This commit is contained in:
parent
0b27300931
commit
a4ea96bebc
1 changed files with 3 additions and 0 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue