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
9cc72c49
Commit
9cc72c49
authored
Aug 21, 2012
by
Bridger Maxwell
Committed by
Victor Shnayder
Aug 21, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Victor's fixes only apply to sqlite. Added a conditional and now they run on mysql.
parent
d13998a1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
lms/djangoapps/courseware/migrations/0003_done_grade_cache.py
+1
-1
lms/djangoapps/courseware/migrations/0004_add_field_studentmodule_course_id.py
+3
-2
No files found.
lms/djangoapps/courseware/migrations/0003_done_grade_cache.py
View file @
9cc72c49
...
...
@@ -10,7 +10,7 @@ class Migration(SchemaMigration):
def
forwards
(
self
,
orm
):
# NOTE (vshnayder): This constraint has the wrong field order, so it doesn't actually
# do anything
. Migration 0004 actually removes this index
.
# do anything
in sqlite. Migration 0004 actually removes this index for sqlite
.
# Removing unique constraint on 'StudentModule', fields ['module_id', 'module_type', 'student']
db
.
delete_unique
(
'courseware_studentmodule'
,
[
'module_id'
,
'module_type'
,
'student_id'
])
...
...
lms/djangoapps/courseware/migrations/0004_add_field_studentmodule_course_id.py
View file @
9cc72c49
...
...
@@ -16,9 +16,10 @@ class Migration(SchemaMigration):
# Removing unique constraint on 'StudentModule', fields ['module_id', 'student']
db
.
delete_unique
(
'courseware_studentmodule'
,
[
'module_id'
,
'student_id'
])
# NOTE: manually remove this constaint (from 0001)--0003 tries, but fails.
# NOTE: manually remove this constaint (from 0001)--0003 tries, but fails
for sqlite
.
# Removing unique constraint on 'StudentModule', fields ['module_id', 'module_type', 'student']
db
.
delete_unique
(
'courseware_studentmodule'
,
[
'student_id'
,
'module_id'
,
'module_type'
])
if
db
.
backend_name
==
"sqlite3"
:
db
.
delete_unique
(
'courseware_studentmodule'
,
[
'student_id'
,
'module_id'
,
'module_type'
])
# Adding unique constraint on 'StudentModule', fields ['course_id', 'module_state_key', 'student']
db
.
create_unique
(
'courseware_studentmodule'
,
[
'student_id'
,
'module_id'
,
'course_id'
])
...
...
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