Commit 8a4165f2 by Eric Fischer Committed by Nimisha Asthagiri

Allow grades app to be zero-migrated

parent 68714c58
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment