(it does work for other languages)
well, at this point I just repeat myself over and over again:
CREATE EXTENSION UNACCENT
Let Django create an empty migration, so you can customize.
python manage.py makemigrations --empty your_app_name
Then add the operation
:
# Generated by Django 5.1b1 on 2024-08-05 01:30
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("your_app_name", "django will fill this with the latest migration for the app"),
]
operations = [
migrations.RunSQL(
"CREATE TEXT SEARCH CONFIGURATION portuguese_unaccent( COPY = portuguese );"
),
migrations.RunSQL(
"ALTER TEXT SEARCH CONFIGURATION portuguese_unaccent "
+ "ALTER MAPPING FOR hword, hword_part, word "
+ "WITH unaccent, portuguese_stem;"
),
]
then just migrate. python manage.py migrate