# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations, models
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField


class Migration(migrations.Migration):

    dependencies = [
        ('grades', '0004_visibleblocks_course_id'),
    ]

    operations = [
        migrations.AlterField(
            model_name='coursepersistentgradesflag',
            name='course_id',
            field=CourseKeyField(max_length=255, db_index=True),
        ),
    ]

@@ -501,16 +501,878 @@
        ),%0A    %5D%0A
+%0A    def unapply(self, project_state, schema_editor, collect_sql=False):%0A        %22%22%22%0A        This is a bit of a hack. This migration is removing a unique index that was erroneously included in the initial%0A        migrations for this app, so it's very likely that IntegrityErrors would result if we did roll this particular%0A        migration back. To avoid this, we override the default unapply method and skip the addition of a unique index%0A        that was never intended to exist.%0A%0A        The assumption here is that you are never going to be specifically targeting a migration %3C 0005 for grades,%0A        and will only ever be migrating backwards if you intend to go all the way back to zero and drop the tables.%0A%0A        If this is not the case and you are reading this comment, please file a PR to help us with your intended usage.%0A        %22%22%22%0A        pass%0A

Allow grades app to be zero-migrated