Merge pull request #14319 from edx/revert-14311-sstudent/TNL-6281
Revert "add index for modified to course and subsection grades"
This commit is contained in:
@@ -1,22 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('grades', '0008_persistentsubsectiongrade_first_attempted'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AlterIndexTogether(
|
|
||||||
name='persistentcoursegrade',
|
|
||||||
index_together=set([('passed_timestamp', 'course_id'), ('modified', 'course_id')]),
|
|
||||||
),
|
|
||||||
migrations.AlterIndexTogether(
|
|
||||||
name='persistentsubsectiongrade',
|
|
||||||
index_together=set([('modified', 'course_id', 'usage_key')]),
|
|
||||||
),
|
|
||||||
]
|
|
||||||
@@ -253,14 +253,6 @@ class PersistentSubsectionGrade(DeleteGradesMixin, TimeStampedModel):
|
|||||||
# * Course staff can see all grades for a course using (course_id,)
|
# * Course staff can see all grades for a course using (course_id,)
|
||||||
('course_id', 'user_id', 'usage_key'),
|
('course_id', 'user_id', 'usage_key'),
|
||||||
]
|
]
|
||||||
# Allows querying in the following ways:
|
|
||||||
# (modified): find all the grades updated within a certain timespan
|
|
||||||
# (modified, course_id): find all the grades updated within a timespan for a certain course
|
|
||||||
# (modified, course_id, usage_key): find all the grades updated within a timespan for a subsection
|
|
||||||
# in a course
|
|
||||||
index_together = [
|
|
||||||
('modified', 'course_id', 'usage_key')
|
|
||||||
]
|
|
||||||
|
|
||||||
# primary key will need to be large for this table
|
# primary key will need to be large for this table
|
||||||
id = UnsignedBigIntAutoField(primary_key=True) # pylint: disable=invalid-name
|
id = UnsignedBigIntAutoField(primary_key=True) # pylint: disable=invalid-name
|
||||||
@@ -510,14 +502,11 @@ class PersistentCourseGrade(DeleteGradesMixin, TimeStampedModel):
|
|||||||
# (course_id) for instructors to see all course grades, implicitly created via the unique_together constraint
|
# (course_id) for instructors to see all course grades, implicitly created via the unique_together constraint
|
||||||
# (user_id) for course dashboard; explicitly declared as an index below
|
# (user_id) for course dashboard; explicitly declared as an index below
|
||||||
# (passed_timestamp, course_id) for tracking when users first earned a passing grade.
|
# (passed_timestamp, course_id) for tracking when users first earned a passing grade.
|
||||||
# (modified): find all the grades updated within a certain timespan
|
|
||||||
# (modified, course_id): find all the grades updated within a certain timespan for a course
|
|
||||||
unique_together = [
|
unique_together = [
|
||||||
('course_id', 'user_id'),
|
('course_id', 'user_id'),
|
||||||
]
|
]
|
||||||
index_together = [
|
index_together = [
|
||||||
('passed_timestamp', 'course_id'),
|
('passed_timestamp', 'course_id'),
|
||||||
('modified', 'course_id')
|
|
||||||
]
|
]
|
||||||
|
|
||||||
# primary key will need to be large for this table
|
# primary key will need to be large for this table
|
||||||
|
|||||||
Reference in New Issue
Block a user