Opened 6 months ago

Closed 6 months 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: master
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 Changed 6 months ago by Xavier Francisco

Owner: changed from nobody to Xavier Francisco
Status: newassigned

comment:2 Changed 6 months ago by Xavier Francisco

Has patch: set

comment:3 Changed 6 months ago by felixxm

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 Changed 6 months ago by felixxm

Patch needs improvement: set

comment:5 Changed 6 months ago by felixxm

Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

comment:6 Changed 6 months ago by Mariusz Felisiak <felisiak.mariusz@…>

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