Commit 1a8d9996 by Bridger Maxwell

Added a migration with indexes on course enrollment and a unique constraint.…

Added a migration with indexes on course enrollment and a unique constraint. This involves a migration that first drops the table, because there may be non-unique data there already.
parent 9f17e0b1
......@@ -90,8 +90,11 @@ class PendingEmailChange(models.Model):
activation_key = models.CharField(('activation key'), max_length=32, unique=True, db_index=True)
class CourseEnrollment(models.Model):
user = models.ForeignKey(User, db_index=True)
course_id = models.CharField(max_length=255)
user = models.ForeignKey(User)
course_id = models.CharField(max_length=255, db_index=True)
class Meta:
unique_together = (('user', 'course_id'), )
#cache_relation(User.profile)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment