Skip to content

Commit 2647ff3

Browse files
committed
fix: restore earthdistance function search paths
Reapply the public search_path for ll_to_earth and earth_box after the earthdistance extension upgrade. TeslaMate previously set these functions to use the public schema to avoid lookup errors around the earth type. The later earthdistance update migration upgrades the extension but does not restore that custom function metadata, which can leave the functions without the expected search path. This adds a follow-up migration that sets the search path for both functions back to public.
1 parent 5f530c5 commit 2647ff3

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
defmodule TeslaMate.Repo.Migrations.SetSearchPathForEarthdistanceFunctions do
2+
use Ecto.Migration
3+
4+
def up do
5+
execute("ALTER FUNCTION ll_to_earth SET search_path = public")
6+
execute("ALTER FUNCTION earth_box SET search_path = public")
7+
end
8+
9+
def down do
10+
:ok
11+
end
12+
end

0 commit comments

Comments
 (0)