django/tests/schema
Clifford Gama 6cc1231285
Some checks are pending
Docs / spelling (push) Waiting to run
Docs / blacken-docs (push) Waiting to run
Docs / lint-docs (push) Waiting to run
Linters / flake8 (push) Waiting to run
Linters / isort (push) Waiting to run
Linters / black (push) Waiting to run
Linters / zizmor (push) Waiting to run
Tests / Windows, SQLite, Python 3.14 (push) Waiting to run
Tests / JavaScript tests (push) Waiting to run
Fixed #36800 -- Restored ManyToManyField renaming in BaseDatabaseSchemaEditor.alter_field().
Regression in f9a44cc0fa.

Now that ManyToManyField is no longer concrete the decision of whether or not
it should be altered, which is also relied on by field renaming, should take
into consideration name changes even if it doesn't have a column associated
with it, as auto-created many-to-many relationship table names are a base of it.

Note that there is room for optimization here where a rename can be entirely
avoided if ManyToManyField.db_table remains stable between .name changes, just
like we do with Field.db_column remaining stable, but since this is a
regression and meant to be backported the current patch focuses on correctness
over further improvements.

Thanks Josik for the report.

Co-authored-by: Simon Charette <charette.s@gmail.com>
2025-12-16 17:45:34 -05:00
..
__init__.py
fields.py Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
models.py Reverted "Fixed #28646 -- Prevented duplicate index when unique is set to True on PostgreSQL." 2024-08-01 09:25:33 +02:00
test_logging.py Fixed #33308 -- Added support for psycopg version 3. 2022-12-15 06:17:57 +01:00
tests.py Fixed #36800 -- Restored ManyToManyField renaming in BaseDatabaseSchemaEditor.alter_field(). 2025-12-16 17:45:34 -05:00