﻿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
31347	CreateExtension should check if migration is allowed.	Petr Přikryl	Hasan Ramezani	"Hi, I have problem migrating some 3rd party database with Django migrations. I have used router for controlling which apps are allowed to be migrated on this database. But I have problem with **HStoreExtension** operation because these operations don't check if they are allowed. And because I have limited rights and I am controlling only my schema on that database I will get error while installing hstore.

Source of trouble:
https://github.com/django/django/blob/master/django/contrib/postgres/operations.py#L18

Work-around/proposal for CreateExtension class:
{{{
class RoutingHStoreExtension(HStoreExtension):
    def database_forwards(self, app_label, schema_editor, from_state, to_state):
        if not router.allow_migrate(schema_editor.connection.alias, app_label):
            return
        return super().database_forwards(app_label, schema_editor, from_state, to_state)
}}}
"	Bug	closed	contrib.postgres	dev	Normal	fixed			Ready for checkin	1	0	0	0	0	0
