aemo_fr/aemo/migrations/0002_unaccent_extension.py

22 lines
623 B
Python
Raw Permalink Normal View History

2024-06-03 16:49:01 +02:00
from django.db import migrations
from django.contrib.postgres.operations import UnaccentExtension
# ref for this migration: https://stackoverflow.com/questions/47230566
class Migration(migrations.Migration):
dependencies = [
('aemo', '0001_initial'),
]
operations = [
UnaccentExtension(),
migrations.RunSQL("CREATE TEXT SEARCH CONFIGURATION french_unaccent(COPY = french);"),
migrations.RunSQL(
"ALTER TEXT SEARCH CONFIGURATION french_unaccent "
"ALTER MAPPING FOR hword, hword_part, word "
"WITH unaccent, french_stem;"
),
]