Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
47afbcf8
Commit
47afbcf8
authored
8 years ago
by
Eric Fischer
Browse files
Options
Downloads
Patches
Plain Diff
Allow grades app to be zero-migrated
parent
205ded99
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lms/djangoapps/grades/migrations/0005_multiple_course_flags.py
+14
-0
14 additions, 0 deletions
...jangoapps/grades/migrations/0005_multiple_course_flags.py
with
14 additions
and
0 deletions
lms/djangoapps/grades/migrations/0005_multiple_course_flags.py
+
14
−
0
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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment