diff --git a/nix/backup_and_restore.nix b/nix/backup_and_restore.nix index 1a30f4bcd5..ee38456a3a 100644 --- a/nix/backup_and_restore.nix +++ b/nix/backup_and_restore.nix @@ -25,6 +25,8 @@ let create schema public; CREATE EXTENSION cube WITH SCHEMA public; CREATE EXTENSION earthdistance WITH SCHEMA public; + ALTER FUNCTION ll_to_earth SET search_path = public; + ALTER FUNCTION earth_box SET search_path = public; . # Restore diff --git a/priv/repo/migrations/20260502120000_set_search_path_for_earthdistance_functions.exs b/priv/repo/migrations/20260502120000_set_search_path_for_earthdistance_functions.exs new file mode 100644 index 0000000000..7b5dca548a --- /dev/null +++ b/priv/repo/migrations/20260502120000_set_search_path_for_earthdistance_functions.exs @@ -0,0 +1,12 @@ +defmodule TeslaMate.Repo.Migrations.SetSearchPathForEarthdistanceFunctions do + use Ecto.Migration + + def up do + execute("ALTER FUNCTION ll_to_earth SET search_path = public") + execute("ALTER FUNCTION earth_box SET search_path = public") + end + + def down do + :ok + end +end diff --git a/website/docs/installation/unsupported/unraid.md b/website/docs/installation/unsupported/unraid.md index beaf9c57dc..24e7ae4f6e 100644 --- a/website/docs/installation/unsupported/unraid.md +++ b/website/docs/installation/unsupported/unraid.md @@ -187,6 +187,8 @@ DROP SCHEMA private CASCADE; CREATE SCHEMA public; CREATE EXTENSION cube WITH SCHEMA public; CREATE EXTENSION earthdistance WITH SCHEMA public; +ALTER FUNCTION ll_to_earth SET search_path = public; +ALTER FUNCTION earth_box SET search_path = public; SQL if [ $? -ne 0 ]; then diff --git a/website/docs/maintenance/backup_restore.mdx b/website/docs/maintenance/backup_restore.mdx index 3c909b6563..089a4598a5 100644 --- a/website/docs/maintenance/backup_restore.mdx +++ b/website/docs/maintenance/backup_restore.mdx @@ -80,6 +80,8 @@ DROP SCHEMA private CASCADE; CREATE SCHEMA public; CREATE EXTENSION cube WITH SCHEMA public; CREATE EXTENSION earthdistance WITH SCHEMA public; +ALTER FUNCTION ll_to_earth SET search_path = public; +ALTER FUNCTION earth_box SET search_path = public; . # Restore