Opened 7 years ago

Closed 7 years ago

#28953 closed Bug (needsinfo)

makemigrations with specified app label tries to connect to other databases that are not directly related

Reported by: André Glatzl Owned by: nobody
Component: Migrations Version: 2.0
Severity: Normal Keywords: makemigrations databases
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When i run 'makemigrations' with the app label defined, i expect only to use the database that is linked to this app. Somehow, makemigrations tries to access databases that are not directly related to the current app. Yes, the models in the app has relations with other databases, which makes sense to check if there is something to migrate but this is kind of irritating because every time, i need to cut of the databases from settings that i don't want to affect (not used by the app).
Maybe it's not a bug but maybe we could convert this to a feature where you could use an argument where it ignores indirectly relationships with databases.
Best regards

Change History (2)

comment:1 by Hrishikesh Barman, 7 years ago

can you give the steps to reproduce this?

comment:2 by Tim Graham, 7 years ago

Component: UncategorizedMigrations
Resolution: needsinfo
Status: newclosed

I guess this is related to the migrations history consistency check (see documentation in c93ac9cf42bff259ab71b70a89b693b9c38e4666). The need for a change in Django isn't completely clear to me -- it sounds like you have databases in your settings that you can't connect to. That doesn't sound like a common use case, and I'm not convinced that Django should go to great length to accommodate that setup. If you have a patch to share, maybe we could reevaluate the idea.

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