[Python-modules-commits] [python-social-auth] 91/131: Added index to Django Association model
Wolfgang Borgert
debacle at moszumanska.debian.org
Sat Dec 24 15:17:06 UTC 2016
This is an automated email from the git hooks/post-receive script.
debacle pushed a commit to tag v0.2.20
in repository python-social-auth.
commit ac42c84a71568ba8289118ece49675f05e1a1ffa
Author: Clinton Blackburn <clinton.blackburn at gmail.com>
Date: Wed Jul 27 22:44:17 2016 -0400
Added index to Django Association model
This unique_together index on the server_url and handle columns ensures lookups do not result in full table scans.
Fixes #967
---
.../default/migrations/0005_auto_20160727_2333.py | 19 +++++++++++++++++++
social/apps/django_app/default/models.py | 3 +++
2 files changed, 22 insertions(+)
diff --git a/social/apps/django_app/default/migrations/0005_auto_20160727_2333.py b/social/apps/django_app/default/migrations/0005_auto_20160727_2333.py
new file mode 100644
index 0000000..3df56ef
--- /dev/null
+++ b/social/apps/django_app/default/migrations/0005_auto_20160727_2333.py
@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.5 on 2016-07-28 02:33
+from __future__ import unicode_literals
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('social_auth', '0004_auto_20160423_0400'),
+ ]
+
+ operations = [
+ migrations.AlterUniqueTogether(
+ name='association',
+ unique_together=set([('server_url', 'handle')]),
+ ),
+ ]
diff --git a/social/apps/django_app/default/models.py b/social/apps/django_app/default/models.py
index 9f18529..047da91 100644
--- a/social/apps/django_app/default/models.py
+++ b/social/apps/django_app/default/models.py
@@ -96,6 +96,9 @@ class Association(models.Model, DjangoAssociationMixin):
class Meta:
db_table = 'social_auth_association'
+ unique_together = (
+ ('server_url', 'handle',)
+ )
class Code(models.Model, DjangoCodeMixin):
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-social-auth.git
More information about the Python-modules-commits
mailing list