#35163: sqlite3.OperationalError: no such column: django_migrations.id
-------------------------------------+-------------------------------------
               Reporter:  milahu     |          Owner:  nobody
                   Type:  Bug        |         Status:  new
              Component:  Database   |        Version:  5.0
  layer (models, ORM)                |
               Severity:  Normal     |       Keywords:  sqlite
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 continue https://github.com/django/django/pull/17815

 the error is caused by a django app, trying to record an applied database
 migration
 django/db/migrations/executor.py

 workaround: add the "id" column explicitly to class Migration

 django/db/migrations/recorder.py

 {{{
             class Migration(models.Model):
                 id = models.IntegerField(primary_key=True)
                 app = models.CharField(max_length=255)
                 name = models.CharField(max_length=255)
                 applied = models.DateTimeField(default=now)
 }}}

 https://github.com/django/django/pull/17815#issuecomment-1925345512

 > Implicit id is added automatically to all models

 but that is not reflected in the sqlite schema: there is no "id" column

 so maybe this is a bug in the sqlite backend
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35163>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018d701b0140-c4aa76d7-bd5a-4aa6-99be-685a7ef81a02-000000%40eu-central-1.amazonses.com.

Reply via email to