-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use simple_unaccent full text search configuration
- Loading branch information
1 parent
46732ec
commit 6f79214
Showing
4 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
resolwe/flow/migrations/0026_create_unaccent_full_text_search_config.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Generated by Django 4.2.9 on 2024-02-13 07:01 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("flow", "0025_add_unaccent_extension"), | ||
] | ||
|
||
operations = [ | ||
migrations.RunSQL( | ||
""" | ||
DO | ||
$$BEGIN | ||
CREATE TEXT SEARCH CONFIGURATION simple_unaccent( COPY = simple ); | ||
EXCEPTION | ||
WHEN unique_violation THEN | ||
NULL; -- ignore error | ||
END;$$; | ||
""" | ||
), | ||
migrations.RunSQL( | ||
"ALTER TEXT SEARCH CONFIGURATION simple_unaccent " | ||
+ "ALTER MAPPING FOR hword, hword_part, word " | ||
+ "WITH unaccent, simple;" | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters