summaryrefslogtreecommitdiff
path: root/django/db/models/indexes.py
AgeCommit message (Collapse)Author
2025-10-13Fixed #36660 -- Fixed a regression in descending Index local field checks.Simon Charette
Regression in 8638d8bf74c1a58302c97d4436ad2eb08438145b. Refs #36273. Thanks Federico Bond for the report.
2025-05-14Fixed #36273 -- Moved Index system checks from Model to Index.check().Tim Graham
2025-03-31Refs #28909 -- Simplified code using unpacking generalizations.Aarni Koskela
2024-01-26Applied Black's 2024 stable style.Mariusz Felisiak
https://github.com/psf/black/releases/tag/24.1.0
2023-01-18Refs #34233 -- Used str.removeprefix()/removesuffix().Mariusz Felisiak
2023-01-18Refs #34233 -- Used types.NoneType.Nick Pope
Available since Python 3.10 where it was reintroduced.
2022-04-22Removed unnecessary variable in Index.create_sql().Hannes Ljungberg
Unnecessary since fdfb3086fcba1b737ec09676ab4bb95105f3371e.
2022-04-13Fixed DatabaseFeatures.supports_index_column_ordering and related tests with ↵Mariusz Felisiak
MyISAM storage engine.
2022-02-07Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2022-02-03Refs #33476 -- Refactored problematic code before reformatting by Black.Mariusz Felisiak
In these cases Black produces unexpected results, e.g. def make_random_password( self, length=10, allowed_chars='abcdefghjkmnpqrstuvwxyz' 'ABCDEFGHJKLMNPQRSTUVWXYZ' '23456789', ): or cursor.execute(""" SELECT ... """, [table name], )
2021-07-15Refs #32508 -- Raised Type/ValueError instead of using "assert" in ↵Daniyal
django.db.models. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-02-19Fixed #32458 -- Made __repr__() for Index and BaseConstraint subclasses more ↵Hannes Ljungberg
consistent.
2021-01-13Fixed #26167 -- Added support for functional indexes.Hannes Ljungberg
Thanks Simon Charette, Mads Jensen, and Mariusz Felisiak for reviews. Co-authored-by: Markus Holtermann <info@markusholtermann.eu>
2021-01-12Refs #26709 -- Made Index raise ValueError on non-string fields.Hannes Ljungberg
2020-12-23Refs #26167 -- Made DatabaseSchemaEditor._create_index_sql()'s fields ↵Hannes Ljungberg
argument optional and kwarg-only.
2020-06-17Refs #28077 -- Added opclasses to Index.__repr__().Mariusz Felisiak
This also removes unnecessary commas between attributes.
2020-06-04Fixed #30913 -- Added support for covering indexes on PostgreSQL 11+.Hannes Ljungberg
2019-11-21Refs #11964 -- Removed SimpleCol in favor of Query(alias_cols).Simon Charette
This prevent having to pass simple_col through multiple function calls by defining whether or not references should be resolved with aliases at the Query level.
2019-10-01Fixed #30651 -- Made __eq__() methods return NotImplemented for not ↵ElizabethU
implemented comparisons. Changed __eq__ to return NotImplemented instead of False if compared to an object of the same type, as is recommended by the Python data model reference. Now these models can be compared to ANY (or other objects with __eq__ overwritten) without returning False automatically.
2019-09-10Fixed #30754 -- Prevented inclusion of aliases in partial index conditions.Simon Charette
SQLite doesn't repoint table aliases in partial index conditions on table rename which breaks the documented table alteration procedure. Thanks Pēteris Caune for the report.
2019-08-21Fixed #21039 -- Added AddIndexConcurrently/RemoveIndexConcurrently ↵Mads Jensen
operations for PostgreSQL. Thanks to Simon Charettes for review. Co-Authored-By: Daniel Tao <daniel.tao@gmail.com>
2019-07-05Fixed #30613 -- Moved index name validation to system checks.can
2019-01-12Used None as the empty value for condition in Index's SQL construction.Paveł Tyślacki
2019-01-01Fixed #30060 -- Moved SQL generation for indexes and constraints to ↵Paveł Tyślacki
SchemaEditor.
2018-10-29Fixed #29547 -- Added support for partial indexes.Mads Jensen
Thanks to Ian Foote, Mariusz Felisiak, Simon Charettes, and Markus Holtermann for comments and feedback.
2018-10-02Added django.db.backends.utils.names_digest() to remove redundant code.Jon Dufresne
2018-06-29Fixed #28077 -- Added support for PostgreSQL opclasses in Index.Ian Foote
Thanks Vinay Karanam for the initial patch.
2018-03-17Removed unused args in Index.clone().Mads Jensen
2018-03-08Fixed #29178 -- Allowed Index.fields to accept a tuple.Fabrizio Ettore Messina
2017-12-05Refs #28876 -- Fixed incorrect class-based model index name generation for ↵Mariusz Felisiak
models with quoted db_table. Thanks Simon Charette and Tim Graham for the review and Carlos E. C. Leite for the report.
2017-08-08Fixed #28465 -- Unified index SQL creation in DatabaseSchemaEditorClaude Paroz
Thanks Tim Graham for the review.
2017-06-27Fixed #28046 -- Added the db_tablespace parameter to class-based indexes.Mariusz Felisiak
Thanks Markus Holtermann and Tim Graham for reviews.
2017-06-27Fixed #28330 -- Prevented passing positional arguments to an Index.Mariusz Felisiak
Thanks Tim Graham for the review.
2017-03-21Fixed #27915 -- Allowed Meta.indexes to be defined in abstract models.Tim Graham
Thanks Markus Holtermann for review.
2017-03-18Fixed #27935 -- Fixed crash with BrinIndex name > 30 characters.Mads Jensen
2017-03-14Used constant instead of hard-coded value for max index name lengthMads Jensen
Refs #26709
2017-01-20Refs #23919 -- Removed unneeded str() callsClaude Paroz
2017-01-19Refs #23919 -- Stopped inheriting from object to define new style classes.Simon Charette
2017-01-18Refs #23919 -- Removed obsolete __ne__() methods.Aymeric Augustin
__ne__() defaults to the opposite of __eq__() on Python 3 when it doesn't return NotImplemented.
2017-01-18Refs #23919 -- Removed encoding preambles and future importsClaude Paroz
2017-01-16Refs #25809 -- Made a few late review comments for BrinIndex.Mads Jensen
2017-01-15Fixed #25809 -- Added BrinIndex support in django.contrib.postgres.Mads Jensen
Thanks Tim Graham and Markus Holtermann for review.
2016-10-10Fixed gis_tests.geoapp when run in isolation.Tim Graham
"from django.db.models import *" in contrib/gis/db/models/__init__.py could obscure gis's functions.py resulting in exceptions like: "module 'django.db.models.functions' has no attribute 'Union'".
2016-08-16Refs #26709 -- Added type check for models.Index fields argument.Akshesh
2016-08-12Fixed #27030 -- Added contrib.postgres.indexes.GinIndex.Akshesh
2016-08-12Fixed #20888 -- Added support for column order in class-based indexes.Akshesh
2016-08-05Fixed #26808 -- Added Meta.indexes for class-based indexes.Akshesh
* Added the index name to its deconstruction. * Added indexes to sqlite3.schema._remake_table() so that indexes aren't dropped when _remake_table() is called. Thanks timgraham & MarkusH for review and advice.
2016-08-02Refs #26709 -- Replaced Index.get_name() with set_name_with_model().Akshesh
This removes the dependency of the Index class on its 'model' attribute.
2016-07-07Refs #26709 -- Added 'model' argument to SchemaEditor.add/remove_index()Akshesh
This removes the dependency of the Index class on its model attribute when a name is passed to it. Thanks to Markush for discussions.