Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
00471d4a
Commit
00471d4a
authored
Jan 11, 2017
by
Sanford Student
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add index for modified to course and subsection grades
and first attempted for subsection for TNL-6281
parent
28e3b1cb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
0 deletions
+54
-0
lms/djangoapps/grades/migrations/0009_auto_20170111_1507.py
+22
-0
lms/djangoapps/grades/migrations/0010_auto_20170112_1156.py
+18
-0
lms/djangoapps/grades/models.py
+14
-0
No files found.
lms/djangoapps/grades/migrations/0009_auto_20170111_1507.py
0 → 100644
View file @
00471d4a
# -*- 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'
)]),
),
]
lms/djangoapps/grades/migrations/0010_auto_20170112_1156.py
0 → 100644
View file @
00471d4a
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'grades'
,
'0009_auto_20170111_1507'
),
]
operations
=
[
migrations
.
AlterIndexTogether
(
name
=
'persistentsubsectiongrade'
,
index_together
=
set
([(
'modified'
,
'course_id'
,
'usage_key'
),
(
'first_attempted'
,
'course_id'
,
'user_id'
)]),
),
]
lms/djangoapps/grades/models.py
View file @
00471d4a
...
@@ -253,6 +253,17 @@ class PersistentSubsectionGrade(DeleteGradesMixin, TimeStampedModel):
...
@@ -253,6 +253,17 @@ 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
# (first_attempted, course_id, user_id): find all attempted subsections in a course for a user
# (first_attempted, course_id): find all attempted subsections in a course for all users
index_together
=
[
(
'modified'
,
'course_id'
,
'usage_key'
),
(
'first_attempted'
,
'course_id'
,
'user_id'
)
]
# 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
...
@@ -502,11 +513,14 @@ class PersistentCourseGrade(DeleteGradesMixin, TimeStampedModel):
...
@@ -502,11 +513,14 @@ 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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment