# Generated by Django 4.2.6 on 2023-10-23 18:56

from django.db import migrations, models
import django.db.models.deletion


def forwards_func(apps, schema_editor):
    # We get the model from the versioned app registry;
    # if we directly import it, it'll be the wrong version
    ContentType = apps.get_model("contenttypes", "ContentType")
    EvaluationItem = apps.get_model("evalu", "EvaluationItem")
    db_alias = schema_editor.connection.alias
    ct = ContentType.objects.using(db_alias).get(app_label="evalu", model="evaluationitem")
    EvaluationItem.objects.using(db_alias).update(
        polymorphic_ctype_id=ct.id
    )

class Migration(migrations.Migration):

    dependencies = [
        ("evalu", "0014_evaluationitem_polymorphic"),
    ]

    operations = [
        migrations.RunPython(
            forwards_func
        ),
    ]
