I was trying to enable the unaccent postgresql extension using a database migration as hinted here:
https://docs.djangoproject.com/en/1.8/ref/contrib/postgres/lookups/#unaccentI created an empty migration and then added the UnaccentExtension operation and ran the migration but the database command "CREATE EXTENSION unaccent" did not get run on my database even though the migration ran without error.
Here is my migration file:
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.contrib.postgres.operations import UnaccentExtension
class Migration(migrations.Migration):
dependencies = [
('maps', '0010_auto_20151010_1756'),
]
operations = [
UnaccentExtension(),
]
Any ideas on how to fix this migration file so that it works?