# Generated by Django 5.2.6 on 2025-10-01 18:23

from django.db import migrations, models
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
from django.db.migrations.state import StateApps


def remove_google_blob(apps: StateApps, schema_editor: BaseDatabaseSchemaEditor) -> None:
    UserProfile = apps.get_model("zerver", "UserProfile")
    RealmUserDefault = apps.get_model("zerver", "RealmUserDefault")

    UserProfile.objects.filter(emojiset="google-blob").update(emojiset="google")
    RealmUserDefault.objects.filter(emojiset="google-blob").update(emojiset="google")


class Migration(migrations.Migration):
    dependencies = [
        ("zerver", "0751_externalauthid_zerver_user_externalauth_uniq"),
    ]

    operations = [
        migrations.RunPython(remove_google_blob, elidable=True),
        migrations.AlterField(
            model_name="realmuserdefault",
            name="emojiset",
            field=models.CharField(
                choices=[("google", "Google"), ("twitter", "Twitter"), ("text", "Plain text")],
                default="google",
                max_length=20,
            ),
        ),
        migrations.AlterField(
            model_name="userprofile",
            name="emojiset",
            field=models.CharField(
                choices=[("google", "Google"), ("twitter", "Twitter"), ("text", "Plain text")],
                default="google",
                max_length=20,
            ),
        ),
    ]
