Merge branch 'feat/allow_alt_text_search_config' into 'develop'
allow user defined text search config in database See merge request pleroma/pleroma!3275
This commit is contained in:
commit
6e68058b63
6 changed files with 123 additions and 5 deletions
|
|
@ -0,0 +1,11 @@
|
|||
defmodule Pleroma.Repo.Migrations.AddDefaultTextSearchConfig do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
execute("DO $$
|
||||
BEGIN
|
||||
execute 'ALTER DATABASE '||current_database()||' SET default_text_search_config = ''english'' ';
|
||||
END
|
||||
$$;")
|
||||
end
|
||||
end
|
||||
|
|
@ -17,7 +17,7 @@ defmodule Pleroma.Repo.Migrations.AddFtsIndexToObjectsTwo do
|
|||
|
||||
execute("CREATE FUNCTION objects_fts_update() RETURNS trigger AS $$
|
||||
begin
|
||||
new.fts_content := to_tsvector('english', new.data->>'content');
|
||||
new.fts_content := to_tsvector(new.data->>'content');
|
||||
return new;
|
||||
end
|
||||
$$ LANGUAGE plpgsql")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue