Skip to content

Commit 520565f

Browse files
committed
support for index_together in Django v5.1 replaced with Meta_indexes
1 parent 6208862 commit 520565f

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424

2525
strategy:
2626
matrix:
27-
#added support to django 5.2 and 5.1
27+
#added support to django 5.2 and 5.1
2828
Python3.13 - Django 5.2:
2929
python.version: '3.13'
3030
tox.env: 'py313-django52'

mssql/schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ def _alter_field(self, model, old_field, new_field, old_type, new_type,
807807
if old_field.db_index and new_field.db_index:
808808
index_columns.append([old_field])
809809
else:
810-
# This block checks all explicit indexes defined in Meta.indexes for the model.
810+
# This block checks all explicit indexes defined in Meta.indexes for the model .
811811
# For each index, it gathers the columns involved and checks if the old_field's column is part of that index.
812812
# If so, it adds the list of columns for that index to index_columns.
813813
# This ensures that when a field is altered or removed, any related custom indexes defined via Meta.indexes are properly handled.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
},
4242
license='BSD',
4343
packages=find_packages(),
44-
#added django support for 5.1 and 5.2
44+
#added django support for 5.1 and 5.2
4545
install_requires=[
4646
'django>=3.2,<5.3',
4747
'pyodbc>=3.0',

testapp/tests/test_indexes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def test_correct_indexes_exist(self):
116116
expected_index_causes = []
117117
if field.db_index:
118118
expected_index_causes.append('db_index=True')
119-
# This block checks if the current field is part of any explicit Index defined in Meta.indexes.
119+
# This block checks if the current field is part of any explicit Index defined in Meta.indexes.
120120
# Meta.indexes is the modern, recommended way to define custom indexes on model fields.
121121
# It is more flexible and powerful than the legacy index_together option, which is now removed.
122122
# By using Meta.indexes, we ensure compatibility with current and future Django versions.

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#added support for django 5.1 and 5.2
1+
#added support for django 5.1 and 5.2
22
[tox]
33
envlist =
44
{py36,py37,py38,py39}-django32,

0 commit comments

Comments
 (0)