mirror of
https://framagit.org/framasoft/mobilizon.git
synced 2024-12-25 01:12:30 +00:00
4ec40d601b
Signed-off-by: Thomas Citharel <tcit@tcit.fr> Rename function to reflect that we only get one result Signed-off-by: Thomas Citharel <tcit@tcit.fr> Add loggers and make Ecto call parallels during search Signed-off-by: Thomas Citharel <tcit@tcit.fr> Implement trigrams for events & replace pg similarity operator % with <% Signed-off-by: Thomas Citharel <tcit@tcit.fr> Fix tests Signed-off-by: Thomas Citharel <tcit@tcit.fr>
41 lines
1.2 KiB
Elixir
41 lines
1.2 KiB
Elixir
defmodule Mobilizon.Repo.Migrations.Prerequites do
|
|
use Ecto.Migration
|
|
|
|
def up do
|
|
IO.puts("\n
|
|
#########################################################
|
|
# If the CREATE EXTENSION or DROP EXTENSION calls fail, #
|
|
# please manually execute them with an authorized #
|
|
# PostgreSQL user with SUPER USER role. #
|
|
#########################################################
|
|
\n
|
|
")
|
|
|
|
execute("""
|
|
CREATE TYPE datetimetz AS (
|
|
dt timestamptz,
|
|
tz varchar
|
|
);
|
|
""")
|
|
|
|
execute("CREATE EXTENSION IF NOT EXISTS postgis")
|
|
execute("CREATE EXTENSION IF NOT EXISTS pg_trgm")
|
|
execute("CREATE EXTENSION IF NOT EXISTS unaccent")
|
|
end
|
|
|
|
def down do
|
|
IO.puts("\n
|
|
#########################################################
|
|
# If the CREATE EXTENSION or DROP EXTENSION calls fail, #
|
|
# please manually execute them with an authorized #
|
|
# PostgreSQL user with SUPER USER role. #
|
|
#########################################################
|
|
\n
|
|
")
|
|
|
|
execute("DROP TYPE IF EXISTS datetimetz;")
|
|
execute("DROP EXTENSION IF EXISTS postgis")
|
|
execute("DROP EXTENSION IF EXISTS pg_trgm")
|
|
execute("DROP EXTENSION IF EXISTS unaccent")
|
|
end
|
|
end
|