Upgrading to django 1.11 not in many columns

I upgrade the project from Django 1.10.8 to 1.11 and suddenly get strange errors in my unit tests.

I used a small hack to update my existing many-to-many relationship to use a regular through table with an additional order field. Everything worked fine at 1.10, but now with an error of 1.11 s

django.db.utils.ProgrammingError: column api_session_pollgroups.pollgroup_id does not exist 

My model code is as follows:

class SessionPollGroup(models.Model):
    session = models.ForeignKey('api.Session')
    pollgroup = models.ForeignKey('api.PollGroup')
    order = models.PositiveSmallIntegerField(default=0)

    class Meta:
        db_table = 'api_session_pollgroups'
        ordering = ('order',)

the api_session_pollgroups table existed earlier when the initial many-to-many relationship was made, and I β€œhijacked it” to add an extra order field.

The relation to the session model is as follows:

    pollgroups = models.ManyToManyField('api.PollGroup',
                                        related_name='sessions',
                                        through=SessionPollGroup)

Does anyone know why this might not generate or find the correct db schema in django 1.11 rather than 1.10?

: , , , , db (postgres), unit test db (sqlite)

!

: . , , - - , , .

+4
1

, , () . django, , :

https://code.djangoproject.com/ticket/29000

, , django 1.11 ( 1.10), . polyfill, , .

0

Source: https://habr.com/ru/post/1694790/


All Articles