Help with UnaccentExtension migration

126 views
Skip to first unread message

pusateri

unread,
Oct 11, 2015, 12:30:19 PM10/11/15
to Django users
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/#unaccent

I 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?

Tim Graham

unread,
Oct 12, 2015, 10:22:32 PM10/12/15
to Django users
That migration file looks correct to me. How did you determine the query didn't get run? Are you logging all queries?
Reply all
Reply to author
Forward
0 new messages