Skip to content

Commit

Permalink
try specifying public schema for extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
swiffer committed Sep 28, 2024
1 parent 01fc100 commit 9ad1ab4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions priv/repo/migrations/20190925152807_create_geo_extensions.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@ defmodule TeslaMate.Repo.Migrations.CreateGeoExtensions do
use Ecto.Migration

def change do
execute("CREATE EXTENSION IF NOT EXISTS cube", "DROP EXTENSION cube")
execute("CREATE EXTENSION IF NOT EXISTS earthdistance", "DROP EXTENSION earthdistance")
execute("CREATE EXTENSION IF NOT EXISTS cube WITH SCHEMA public", "DROP EXTENSION cube")

execute(
"CREATE EXTENSION IF NOT EXISTS earthdistance WITH SCHEMA public",
"DROP EXTENSION earthdistance"
)

create(index(:geofences, ["(earth_box(ll_to_earth(latitude, longitude), radius))"]))
end
end
4 changes: 2 additions & 2 deletions website/docs/maintenance/backup_restore.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ docker compose stop teslamate
docker compose exec -T database psql -U teslamate teslamate << .
drop schema public cascade;
create schema public;
create extension cube;
create extension earthdistance;
create extension cube with schema public;
create extension earthdistance with schema public;
CREATE OR REPLACE FUNCTION public.ll_to_earth(float8, float8)
RETURNS public.earth
LANGUAGE SQL
Expand Down

0 comments on commit 9ad1ab4

Please sign in to comment.