Merge pull request #14071 from edx/efischer/reversify_migration
Allow grades app to be zero-migrated
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user