#23273: MigrationRecorder does not obey db_router allow_migrate rules
----------------------------+------------------------------------
Reporter: froomzy | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+------------------------------------
Comment (by jorisvd):
I can confirm marfire's findings.
1/ For example even with this router applied:
{{{
class testerouter(object):
def allow_migrate(self, db, app_label, model_name=None, **hints):
return False
}}}
And then executing:
{{{
migrate --database=replica
}}}
All apps and models migrations get applied to this replica database, while
according to the router nothing should happen at all.
2/ From the documentation it is not clear whether it is possible to
isolate certain models from certain databases, or whether isolation can
only be done on the app-level. From the description in the documentation,
it seems possible to use the model_name argument for this, but by the way
django stores its migrations, I don't see how that could work.
--
Ticket URL: <https://code.djangoproject.com/ticket/23273#comment:15>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/065.b4b8e3e05afd0e38efe8a4d2d81134c0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.