#34525: index_together warning after migration to new style
-------------------------------------+-------------------------------------
               Reporter:  Mateusz    |          Owner:  nobody
  Legięcki                           |
                   Type:  Bug        |         Status:  new
              Component:  Database   |        Version:  4.2
  layer (models, ORM)                |       Keywords:  index_together,
               Severity:  Normal     |  warning
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 I've got deprecation warning about `index_together` after migration to new
 style with `model.Index(fields=[...])`. I'm using pytest as test suite. I
 created minimal example, it is available on my GH:
 https://github.com/Behoston/idx_to_bug

 logs:

 {{{
 x/tests.py::test_x
   /home/behoston/venv/idx_to/lib/python3.11/site-
 packages/django/db/models/options.py:210: RemovedInDjango51Warning:
 'index_together' is deprecated. Use 'Meta.indexes' in 'x.Item' instead.
     warnings.warn(

 -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

 }}}


 For fresh indexes it works fine (no warning), so I assume that problem is
 only during migrations when models from migrations files are evaluated.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34525>
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/01070187c7c95510-2c0df5d6-cb0d-45f0-9d28-97520c29ccc5-000000%40eu-central-1.amazonses.com.

Reply via email to