1
0
Fork 0
mirror of https://framagit.org/framasoft/mobilizon.git synced 2024-12-25 01:12:30 +00:00
mobilizon/priv/repo/migrations/20220407083712_add_indexes_to_addresses.exs
Thomas Citharel 70cb96dc96
Add spatial indexes on address table
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2022-04-07 10:51:31 +02:00

13 lines
486 B
Elixir

defmodule Mobilizon.Storage.Repo.Migrations.AddIndexesToAddresses do
use Ecto.Migration
def up do
create_if_not_exists(index("addresses", ["st_x(geom)"], name: "idx_addresses_geom_x"))
create_if_not_exists(index("addresses", ["st_y(geom)"], name: "idx_addresses_geom_y"))
end
def down do
drop_if_exists(index("addresses", ["st_x(geom)"], name: "idx_addresses_geom_x"))
drop_if_exists(index("addresses", ["st_y(geom)"], name: "idx_addresses_geom_y"))
end
end