GitHub PullRequestReviewCommentEvent at 2014-01-06 00:43:19
Repository: django
Actor: manfre
Payload: {"comment":{"url":"https://api.github.com/repos/django/django/pulls/comments/8657700","id":8657700,"diff_hunk":"@@ -757,41 +702,65 @@ def _alter_many_to_many(self, model, old_field, new_field, strict):\n             new_field.rel.through._meta.get_field_by_name(new_field.m2m_reverse_field_name())[0],\n         )\n \n-    def _create_index_name(self, model, column_names, suffix=\"\"):\n+    # Map provides a concise prefix for constraints of the same type\n+    constraint_type_prefix_map = {\n+        'UNIQUE': 'UX_',\n+        'INDEX': 'IX_',\n+        'DEFAULT': 'DF_',\n+        'CHECK': 'CK_',\n+        'PK': 'PK_',\n+        'FK': 'FK_',\n+        '': '',\n+    }\n+\n+    def _delete_db_constraint_sql(self, model, name, constraint_type, values={}, params=[]):","path":"django/db/backends/schema.py","position":717,"original_position":717,"commit_id":"47e6f3e968d686903257fe1cdead936c463e7f92","original_commit_id":"47e6f3e968d686903257fe1cdead936c463e7f92","user":{"login":"manfre","id":30523,"avatar_url":"https://gravatar.com/avatar/c7530c529dc2ddca9b1626d90acf4366?d=https%3A%2F%2Fidenticons.github.com%2Fd613ca9ece1fec54ec026f15b9a000b2.png&r=x","gravatar_id":"c7530c529dc2ddca9b1626d90acf4366","url":"https://api.github.com/users/manfre","html_url":"https://github.com/manfre","followers_url":"https://api.github.com/users/manfre/followers","following_url":"https://api.github.com/users/manfre/following{/other_user}","gists_url":"https://api.github.com/users/manfre/gists{/gist_id}","starred_url":"https://api.github.com/users/manfre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manfre/subscriptions","organizations_url":"https://api.github.com/users/manfre/orgs","repos_url":"https://api.github.com/users/manfre/repos","events_url":"https://api.github.com/users/manfre/events{/privacy}","received_events_url":"https://api.github.com/users/manfre/received_events","type":"User","site_admin":false},"body":"Nothing ever makes sense for all backends. Some don't treat them all as constraints, but some do. If everything was the same for all databases, this pull request wouldn't exist.\r\n\r\nThe purpose of my change was to provide a single method for 3rd party backends to hook, which is much friendlier to those of us that need to hook the API.","created_at":"2014-01-06T00:43:19Z","updated_at":"2014-01-06T00:43:19Z","html_url":"https://github.com/django/django/pull/2143#discussion_r8657700","pull_request_url":"https://api.github.com/repos/django/django/pulls/2143","_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/comments/8657700"},"html":{"href":"https://github.com/django/django/pull/2143#discussion_r8657700"},"pull_request":{"href":"https://api.github.com/repos/django/django/pulls/2143"}}}}