{"action":"created","comment":{"url":"https://api.github.com/repos/django/django/pulls/comments/22647063","id":22647063,"diff_hunk":"@@ -98,17 +98,15 @@ def references_field(self, model_name, name, app_label=None):\n         \"\"\"\n         return self.references_model(model_name, app_label)\n \n-    def allowed_to_migrate(self, connection_alias, model):\n+    def allowed_to_migrate(self, connection_alias, model, hints=None):\n         \"\"\"\n-        Returns if we're allowed to migrate the model. Checks the router,\n-        if it's a proxy, if it's managed, and if it's swapped out.\n+        Returns if we're allowed to migrate the model.\n         \"\"\"\n-        return (\n-            not model._meta.proxy and\n-            not model._meta.swapped and\n-            model._meta.managed and\n-            router.allow_migrate(connection_alias, model)\n-        )\n+        # Always skip if proxy, unmanaged or swapped out.\n+        if model and (model._meta.proxy or model._meta.swapped or not model._meta.managed):\n+            return False\n+","path":"django/db/migrations/operations/base.py","position":20,"original_position":20,"commit_id":"87c38ae80e93400a2e21523ef08dff44c577dfea","original_commit_id":"87c38ae80e93400a2e21523ef08dff44c577dfea","user":{"login":"MarkusH","id":475613,"avatar_url":"https://avatars.githubusercontent.com/u/475613?v=3","gravatar_id":"","url":"https://api.github.com/users/MarkusH","html_url":"https://github.com/MarkusH","followers_url":"https://api.github.com/users/MarkusH/followers","following_url":"https://api.github.com/users/MarkusH/following{/other_user}","gists_url":"https://api.github.com/users/MarkusH/gists{/gist_id}","starred_url":"https://api.github.com/users/MarkusH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarkusH/subscriptions","organizations_url":"https://api.github.com/users/MarkusH/orgs","repos_url":"https://api.github.com/users/MarkusH/repos","events_url":"https://api.github.com/users/MarkusH/events{/privacy}","received_events_url":"https://api.github.com/users/MarkusH/received_events","type":"User","site_admin":false},"body":"You had a `if not model and not hints` here before. Any reason why this is gone? The only thing I can think of, routers have to take care of `model=None` anyways,  so this \"precaution\" isn't necessary anymore.","created_at":"2015-01-08T11:37:22Z","updated_at":"2015-01-08T11:37:22Z","html_url":"https://github.com/django/django/pull/3849#discussion_r22647063","pull_request_url":"https://api.github.com/repos/django/django/pulls/3849","_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/comments/22647063"},"html":{"href":"https://github.com/django/django/pull/3849#discussion_r22647063"},"pull_request":{"href":"https://api.github.com/repos/django/django/pulls/3849"}}},"pull_request":{"url":"https://api.github.com/repos/django/django/pulls/3849","id":26946999,"html_url":"https://github.com/django/django/pull/3849","diff_url":"https://github.com/django/django/pull/3849.diff","patch_url":"https://github.com/django/django/pull/3849.patch","issue_url":"https://api.github.com/repos/django/django/issues/3849","number":3849,"state":"open","locked":false,"title":" Fixed #22583 -- RunPython and RunSQL can now provide hints to the db router.","user":{"login":"loic","id":36160,"avatar_url":"https://avatars.githubusercontent.com/u/36160?v=3","gravatar_id":"","url":"https://api.github.com/users/loic","html_url":"https://github.com/loic","followers_url":"https://api.github.com/users/loic/followers","following_url":"https://api.github.com/users/loic/following{/other_user}","gists_url":"https://api.github.com/users/loic/gists{/gist_id}","starred_url":"https://api.github.com/users/loic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loic/subscriptions","organizations_url":"https://api.github.com/users/loic/orgs","repos_url":"https://api.github.com/users/loic/repos","events_url":"https://api.github.com/users/loic/events{/privacy}","received_events_url":"https://api.github.com/users/loic/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-01-07T09:47:00Z","updated_at":"2015-01-08T11:37:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"604da0d302ef32e640ede374913c09d8e4c513d8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/django/django/pulls/3849/commits","review_comments_url":"https://api.github.com/repos/django/django/pulls/3849/comments","review_comment_url":"https://api.github.com/repos/django/django/pulls/comments/{number}","comments_url":"https://api.github.com/repos/django/django/issues/3849/comments","statuses_url":"https://api.github.com/repos/django/django/statuses/87c38ae80e93400a2e21523ef08dff44c577dfea","head":{"label":"loic:migrations_hints","ref":"migrations_hints","sha":"87c38ae80e93400a2e21523ef08dff44c577dfea","user":{"login":"loic","id":36160,"avatar_url":"https://avatars.githubusercontent.com/u/36160?v=3","gravatar_id":"","url":"https://api.github.com/users/loic","html_url":"https://github.com/loic","followers_url":"https://api.github.com/users/loic/followers","following_url":"https://api.github.com/users/loic/following{/other_user}","gists_url":"https://api.github.com/users/loic/gists{/gist_id}","starred_url":"https://api.github.com/users/loic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loic/subscriptions","organizations_url":"https://api.github.com/users/loic/orgs","repos_url":"https://api.github.com/users/loic/repos","events_url":"https://api.github.com/users/loic/events{/privacy}","received_events_url":"https://api.github.com/users/loic/received_events","type":"User","site_admin":false},"repo":{"id":4394214,"name":"django","full_name":"loic/django","owner":{"login":"loic","id":36160,"avatar_url":"https://avatars.githubusercontent.com/u/36160?v=3","gravatar_id":"","url":"https://api.github.com/users/loic","html_url":"https://github.com/loic","followers_url":"https://api.github.com/users/loic/followers","following_url":"https://api.github.com/users/loic/following{/other_user}","gists_url":"https://api.github.com/users/loic/gists{/gist_id}","starred_url":"https://api.github.com/users/loic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loic/subscriptions","organizations_url":"https://api.github.com/users/loic/orgs","repos_url":"https://api.github.com/users/loic/repos","events_url":"https://api.github.com/users/loic/events{/privacy}","received_events_url":"https://api.github.com/users/loic/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/loic/django","description":"The Web framework for perfectionists with deadlines. Now on GitHub.","fork":true,"url":"https://api.github.com/repos/loic/django","forks_url":"https://api.github.com/repos/loic/django/forks","keys_url":"https://api.github.com/repos/loic/django/keys{/key_id}","collaborators_url":"https://api.github.com/repos/loic/django/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/loic/django/teams","hooks_url":"https://api.github.com/repos/loic/django/hooks","issue_events_url":"https://api.github.com/repos/loic/django/issues/events{/number}","events_url":"https://api.github.com/repos/loic/django/events","assignees_url":"https://api.github.com/repos/loic/django/assignees{/user}","branches_url":"https://api.github.com/repos/loic/django/branches{/branch}","tags_url":"https://api.github.com/repos/loic/django/tags","blobs_url":"https://api.github.com/repos/loic/django/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/loic/django/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/loic/django/git/refs{/sha}","trees_url":"https://api.github.com/repos/loic/django/git/trees{/sha}","statuses_url":"https://api.github.com/repos/loic/django/statuses/{sha}","languages_url":"https://api.github.com/repos/loic/django/languages","stargazers_url":"https://api.github.com/repos/loic/django/stargazers","contributors_url":"https://api.github.com/repos/loic/django/contributors","subscribers_url":"https://api.github.com/repos/loic/django/subscribers","subscription_url":"https://api.github.com/repos/loic/django/subscription","commits_url":"https://api.github.com/repos/loic/django/commits{/sha}","git_commits_url":"https://api.github.com/repos/loic/django/git/commits{/sha}","comments_url":"https://api.github.com/repos/loic/django/comments{/number}","issue_comment_url":"https://api.github.com/repos/loic/django/issues/comments/{number}","contents_url":"https://api.github.com/repos/loic/django/contents/{+path}","compare_url":"https://api.github.com/repos/loic/django/compare/{base}...{head}","merges_url":"https://api.github.com/repos/loic/django/merges","archive_url":"https://api.github.com/repos/loic/django/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/loic/django/downloads","issues_url":"https://api.github.com/repos/loic/django/issues{/number}","pulls_url":"https://api.github.com/repos/loic/django/pulls{/number}","milestones_url":"https://api.github.com/repos/loic/django/milestones{/number}","notifications_url":"https://api.github.com/repos/loic/django/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/loic/django/labels{/name}","releases_url":"https://api.github.com/repos/loic/django/releases{/id}","created_at":"2012-05-21T14:04:30Z","updated_at":"2014-07-15T10:39:50Z","pushed_at":"2015-01-08T10:00:55Z","git_url":"git://github.com/loic/django.git","ssh_url":"git@github.com:loic/django.git","clone_url":"https://github.com/loic/django.git","svn_url":"https://github.com/loic/django","homepage":"http://www.djangoproject.com/","size":112746,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"django:master","ref":"master","sha":"862ea825b5073588efafd5b7eed349ad098b5fe1","user":{"login":"django","id":27804,"avatar_url":"https://avatars.githubusercontent.com/u/27804?v=3","gravatar_id":"","url":"https://api.github.com/users/django","html_url":"https://github.com/django","followers_url":"https://api.github.com/users/django/followers","following_url":"https://api.github.com/users/django/following{/other_user}","gists_url":"https://api.github.com/users/django/gists{/gist_id}","starred_url":"https://api.github.com/users/django/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/django/subscriptions","organizations_url":"https://api.github.com/users/django/orgs","repos_url":"https://api.github.com/users/django/repos","events_url":"https://api.github.com/users/django/events{/privacy}","received_events_url":"https://api.github.com/users/django/received_events","type":"Organization","site_admin":false},"repo":{"id":4164482,"name":"django","full_name":"django/django","owner":{"login":"django","id":27804,"avatar_url":"https://avatars.githubusercontent.com/u/27804?v=3","gravatar_id":"","url":"https://api.github.com/users/django","html_url":"https://github.com/django","followers_url":"https://api.github.com/users/django/followers","following_url":"https://api.github.com/users/django/following{/other_user}","gists_url":"https://api.github.com/users/django/gists{/gist_id}","starred_url":"https://api.github.com/users/django/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/django/subscriptions","organizations_url":"https://api.github.com/users/django/orgs","repos_url":"https://api.github.com/users/django/repos","events_url":"https://api.github.com/users/django/events{/privacy}","received_events_url":"https://api.github.com/users/django/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/django/django","description":"The Web framework for perfectionists with deadlines.","fork":false,"url":"https://api.github.com/repos/django/django","forks_url":"https://api.github.com/repos/django/django/forks","keys_url":"https://api.github.com/repos/django/django/keys{/key_id}","collaborators_url":"https://api.github.com/repos/django/django/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/django/django/teams","hooks_url":"https://api.github.com/repos/django/django/hooks","issue_events_url":"https://api.github.com/repos/django/django/issues/events{/number}","events_url":"https://api.github.com/repos/django/django/events","assignees_url":"https://api.github.com/repos/django/django/assignees{/user}","branches_url":"https://api.github.com/repos/django/django/branches{/branch}","tags_url":"https://api.github.com/repos/django/django/tags","blobs_url":"https://api.github.com/repos/django/django/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/django/django/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/django/django/git/refs{/sha}","trees_url":"https://api.github.com/repos/django/django/git/trees{/sha}","statuses_url":"https://api.github.com/repos/django/django/statuses/{sha}","languages_url":"https://api.github.com/repos/django/django/languages","stargazers_url":"https://api.github.com/repos/django/django/stargazers","contributors_url":"https://api.github.com/repos/django/django/contributors","subscribers_url":"https://api.github.com/repos/django/django/subscribers","subscription_url":"https://api.github.com/repos/django/django/subscription","commits_url":"https://api.github.com/repos/django/django/commits{/sha}","git_commits_url":"https://api.github.com/repos/django/django/git/commits{/sha}","comments_url":"https://api.github.com/repos/django/django/comments{/number}","issue_comment_url":"https://api.github.com/repos/django/django/issues/comments/{number}","contents_url":"https://api.github.com/repos/django/django/contents/{+path}","compare_url":"https://api.github.com/repos/django/django/compare/{base}...{head}","merges_url":"https://api.github.com/repos/django/django/merges","archive_url":"https://api.github.com/repos/django/django/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/django/django/downloads","issues_url":"https://api.github.com/repos/django/django/issues{/number}","pulls_url":"https://api.github.com/repos/django/django/pulls{/number}","milestones_url":"https://api.github.com/repos/django/django/milestones{/number}","notifications_url":"https://api.github.com/repos/django/django/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/django/django/labels{/name}","releases_url":"https://api.github.com/repos/django/django/releases{/id}","created_at":"2012-04-28T02:47:18Z","updated_at":"2015-01-08T11:22:11Z","pushed_at":"2015-01-08T00:29:42Z","git_url":"git://github.com/django/django.git","ssh_url":"git@github.com:django/django.git","clone_url":"https://github.com/django/django.git","svn_url":"https://github.com/django/django","homepage":"https://www.djangoproject.com/","size":241244,"stargazers_count":12502,"watchers_count":12502,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4886,"mirror_url":null,"open_issues_count":65,"forks":4886,"open_issues":65,"watchers":12502,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/3849"},"html":{"href":"https://github.com/django/django/pull/3849"},"issue":{"href":"https://api.github.com/repos/django/django/issues/3849"},"comments":{"href":"https://api.github.com/repos/django/django/issues/3849/comments"},"review_comments":{"href":"https://api.github.com/repos/django/django/pulls/3849/comments"},"review_comment":{"href":"https://api.github.com/repos/django/django/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/django/django/pulls/3849/commits"},"statuses":{"href":"https://api.github.com/repos/django/django/statuses/87c38ae80e93400a2e21523ef08dff44c577dfea"}}}}