Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/signaling/stores/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ func (s *PostgresStore) UpdatePeerGeo(ctx context.Context, peerID string, lat, l
lat = $1,
lon = $2,
geo = CASE
WHEN $1 IS NOT NULL AND $2 IS NOT NULL THEN ll_to_earth($1, $2)
WHEN $1 IS NOT NULL AND $2 IS NOT NULL THEN ll_to_earth($1::float8, $2::float8)
ELSE NULL
END,
updated_at = $3
Expand Down
3 changes: 3 additions & 0 deletions migrations/1765287380_peers_lat_lon.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE "peers"
DROP COLUMN IF EXISTS "lat",
DROP COLUMN IF EXISTS "lon";
3 changes: 3 additions & 0 deletions migrations/1765287380_peers_lat_lon.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE "peers"
ADD COLUMN IF NOT EXISTS "lat" float8,
ADD COLUMN IF NOT EXISTS "lon" float8;
2 changes: 1 addition & 1 deletion migrations/latest.lock
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1764692636_latency2_geo
1765287380_peers_lat_lon