Mayel de Borniol 2024-01-15 14:43:31 +00:00
parent fd92a092ab
commit b5ee543b37
3 changed files with 14 additions and 2 deletions

View file

@ -10,12 +10,19 @@ defmodule Bonfire.Repo.Migrations.GinIndexes do
def up do
execute "CREATE EXTENSION IF NOT EXISTS pg_trgm;"
create_index("bonfire_data_social_named", "name")
create_index("bonfire_data_identity_character", "username")
create_index("bonfire_data_social_profile", "name")
# create_index("bonfire_data_social_profile", "name")
create_index_fields(
"bonfire_data_social_profile",
"name gin_trgm_ops, summary gin_trgm_ops"
)
create_index_fields(
"bonfire_data_social_post_content",
"name gin_trgm_ops, summary gin_trgm_ops, html_body gin_trgm_ops"
# "name gin_trgm_ops, summary gin_trgm_ops, html_body gin_trgm_ops"
"name gin_trgm_ops, summary gin_trgm_ops"
)
end
@ -28,6 +35,10 @@ defmodule Bonfire.Repo.Migrations.GinIndexes do
end
def create_index_fields(table, fields) do
execute """
DROP INDEX IF EXISTS #{table}_gin_index;
"""
execute """
CREATE INDEX CONCURRENTLY #{table}_gin_index
ON #{table}

View file

@ -833,6 +833,7 @@ sys-deps-debian:
# to test federation locally you can use `just dev-federate` or `just test-federation-live-DRAGONS`
# and run this in seperate terminal to start the above tunnel: `just tunnel-start`
# this requires `cargo install tunnelto` (the homebrew version of tunnelto doesn't work)
@tunnel-start:
echo "Opening tunnel on ${TUNNEL_SUBDOMAIN}.tunnelto.dev"
tunnelto --subdomain $TUNNEL_SUBDOMAIN --port 4000