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
47afbcf8
Commit
47afbcf8
authored
Nov 29, 2016
by
Eric Fischer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow grades app to be zero-migrated
parent
205ded99
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
lms/djangoapps/grades/migrations/0005_multiple_course_flags.py
+14
-0
No files found.
lms/djangoapps/grades/migrations/0005_multiple_course_flags.py
View file @
47afbcf8
...
...
@@ -18,3 +18,17 @@ class Migration(migrations.Migration):
field
=
CourseKeyField
(
max_length
=
255
,
db_index
=
True
),
),
]
def
unapply
(
self
,
project_state
,
schema_editor
,
collect_sql
=
False
):
"""
This is a bit of a hack. This migration is removing a unique index that was erroneously included in the initial
migrations for this app, so it's very likely that IntegrityErrors would result if we did roll this particular
migration back. To avoid this, we override the default unapply method and skip the addition of a unique index
that was never intended to exist.
The assumption here is that you are never going to be specifically targeting a migration < 0005 for grades,
and will only ever be migrating backwards if you intend to go all the way back to zero and drop the tables.
If this is not the case and you are reading this comment, please file a PR to help us with your intended usage.
"""
pass
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