Compare commits
No commits in common. "01bdebb03f69c32c089d19085c2e8e85544ee82b" and "8376ca1ddae804773c10c1a1c7f0d6ed1af9b617" have entirely different histories.
01bdebb03f
...
8376ca1dda
|
@ -2,23 +2,23 @@ defmodule Pleroma.Repo.Migrations.CreatePgroongaIndex do
|
||||||
use Ecto.Migration
|
use Ecto.Migration
|
||||||
|
|
||||||
def up do
|
def up do
|
||||||
execute("DROP INDEX IF EXISTS objects_fts")
|
|
||||||
|
|
||||||
execute("CREATE EXTENSION IF NOT EXISTS pgroonga")
|
execute("CREATE EXTENSION IF NOT EXISTS pgroonga")
|
||||||
|
|
||||||
create_if_not_exists(
|
drop_if_exists(
|
||||||
index(:objects, ["(data->'content') pgroonga_jsonb_full_text_search_ops_v2"],
|
index(:objects, ["(to_tsvector('english', data->>'content'))"],
|
||||||
using: :pgroonga,
|
using: :gin,
|
||||||
name: :object_content_pgroonga
|
name: :objects_fts
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
execute(
|
||||||
|
"CREATE INDEX object_content_pgroonga ON objects USING pgroonga ((data->'content') pgroonga_jsonb_full_text_search_ops_v2)"
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
def down do
|
def down do
|
||||||
execute("DROP INDEX IF EXISTS object_content_pgroonga")
|
execute("DROP INDEX IF EXISTS object_content_pgroonga")
|
||||||
|
|
||||||
execute("DROP EXTENSION IF EXISTS pgroonga")
|
|
||||||
|
|
||||||
create_if_not_exists(
|
create_if_not_exists(
|
||||||
index(:objects, ["(to_tsvector('english', data->>'content'))"],
|
index(:objects, ["(to_tsvector('english', data->>'content'))"],
|
||||||
using: :gin,
|
using: :gin,
|
||||||
|
|
Loading…
Reference in New Issue