Saturday, May 30, 2015

Migrate command does not respect options for db connections?

Context:

Django 1.7.1
PostgreSQL 9.4

I have the following database entry in settings:

DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'xpto',
'USER': 'postgres',
'PASSWORD': 'postgres',
'HOST': 'localhost',
'PORT': '5432',
'OPTIONS': {
'options': '-c search_path=xpto,public'
}
}
}

And the following model:

class ModelA(models.Model):
    att_a = models.CharField(max_length=10)

I' just created a migration with makemigrations for this app. It does not have any indication of schema, whatsoever.

When I ran the migration, with migrate, the table ended up on the public schema.

Bug?

--
George R. C. Silva
Sigma Geosistemas LTDA
----------------------------

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAGyPVTvGh7HTGGyTgj4Qu8cpxp9ddDTmBY7si4uoq9Z484%2BX8w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment