1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

[6.0.x] Fixed #36660 -- Fixed a regression in descending Index local field checks.

Regression in 8638d8bf74.

Refs #36273.

Thanks Federico Bond for the report.

Backport of edde2891c3 from main.
This commit is contained in:
Simon Charette
2025-10-12 12:57:32 -04:00
committed by Natalia
parent c4309f4627
commit 86e7406cfb
2 changed files with 15 additions and 1 deletions

View File

@@ -185,6 +185,15 @@ class IndexesTests(TestCase):
],
)
def test_pointing_to_desc_field(self):
class Model(models.Model):
name = models.CharField(max_length=100)
class Meta:
indexes = [models.Index(fields=["-name"], name="index_name")]
self.assertEqual(Model.check(databases=self.databases), [])
def test_pointing_to_m2m_field(self):
class Model(models.Model):
m2m = models.ManyToManyField("self")