# Generated by Django 3.2.12 on 2022-03-01 18:46

from django.db import migrations, models


def remove_white(apps, schema_editor):
    """don't hardcode white announcements"""
    db_alias = schema_editor.connection.alias
    announcement_model = apps.get_model("bookwyrm", "Announcement")
    announcement_model.objects.using(db_alias).filter(display_type="white-ter").update(
        display_type=None
    )


class Migration(migrations.Migration):

    dependencies = [
        ("bookwyrm", "0143_merge_0142_auto_20220227_1752_0142_user_hide_follows"),
    ]

    operations = [
        migrations.AlterField(
            model_name="announcement",
            name="display_type",
            field=models.CharField(
                blank=True,
                choices=[
                    ("primary-light", "Primary"),
                    ("success-light", "Success"),
                    ("link-light", "Link"),
                    ("warning-light", "Warning"),
                    ("danger-light", "Danger"),
                ],
                max_length=20,
                null=True,
            ),
        ),
        migrations.RunPython(remove_white, reverse_code=migrations.RunPython.noop),
    ]
