# Generated by Django 4.2.4 on 2024-07-22 15:52
# edited by hand to add the populate_last_summarized_at function
# and remove the null=True from the field
from django.db import migrations, models

def populate_last_summarized_at(apps, schema_editor):
    Session = apps.get_model('askbot', 'Session')
    Session.objects.all().update(last_summarized_at=models.F('created_at'))


class Migration(migrations.Migration):

    dependencies = [
        ('askbot', '0030_event_summarized_group_used_for_analytics_and_more'),
    ]

    operations = [
        migrations.AddField(
            model_name='session',
            name='last_summarized_at',
            field=models.DateTimeField(null=True),
        ),
        migrations.RunPython(populate_last_summarized_at, reverse_code=migrations.RunPython.noop),
        migrations.AlterField(
            model_name='session',
            name='last_summarized_at',
            field=models.DateTimeField(null=False)
        ),
    ]
