Opened 4 years ago

Closed 4 years ago

#31277 closed Bug (fixed)

System check fields.E340 should be relaxed when DATABASE_ROUTERS is present.

Reported by: Xavier Francisco Owned by: Xavier Francisco
Component: Core (System checks) Version: dev
Severity: Normal Keywords: database-router, manytomany
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Hey.

On PR https://github.com/django/django/pull/11630, changes were made to change to allow for multiple models with the same db_name. Instead of an Error (models.E028), a Warning was created to be used in lieu of it, when DATABASE_ROUTERS is present.

The same issue arises, with a different check, when using ManyToManyField, with clashing db_names. The system check in question is fields.E340.

My suggestion would be to do apply the same change for this check, and raise a Warning instead, whenever DATABASE_ROUTERS exists.
At this point, the only workaround is silencing the error system check.

Change History (6)

comment:1 by Xavier Francisco, 4 years ago

Owner: changed from nobody to Xavier Francisco
Status: newassigned

comment:2 by Xavier Francisco, 4 years ago

Has patch: set

comment:3 by Mariusz Felisiak, 4 years ago

Summary: System check fields.E340 should be relaxed when DATABASE_ROUTERS is presentSystem check fields.E340 should be relaxed when DATABASE_ROUTERS is present.
Triage Stage: UnreviewedAccepted
Version: 3.0master

comment:4 by Mariusz Felisiak, 4 years ago

Patch needs improvement: set

comment:5 by Mariusz Felisiak, 4 years ago

Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

comment:6 by Mariusz Felisiak <felisiak.mariusz@…>, 4 years ago

Resolution: fixed
Status: assignedclosed

In 86908785:

Fixed #31277 -- Relaxed system check of m2m intermediary tables for db_table collision when database routers are installed.

Turned the error into a warning when database routers are installed.

Note: See TracTickets for help on using tickets.
Back to Top