﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
32067	Add Operation.allow_migrate().	George Sakkis	nobody	"Most Django migration operations call `self.allow_migrate_model()` in `database_forwards`/`database_backwards` to check if the operation should be applied. There are two exceptions however: `RunPython` and `RunSQL`. These don't go through `self.allow_migrate_model()` but call directly `router.allow_migrate()`, passing arbitrary `self.hints` as keyword args (conversely, all other operations don't support arbitrary hints; the only fixed hints are `model_name` and `model`). This difference is problematic for any library/function that tries to inspect or modify the behavior of arbitrary migration operations. 

I'd like to propose a new `Operation.allow_migrate()` method which will act as the single point of access to the router: all migration operations will call it (directly or indirectly) in `database_forwards`/`database_backwards`. By default this is just a wrapper around `router.allow_migrate()` but it can (and will) be overriden. 

Happy to work on a PR if the idea is accepted.
"	New feature	closed	Migrations	3.1	Normal	needsinfo		Loic Bistuer Markus Holtermann	Unreviewed	0	0	0	0	0	0
