# Generated by Django 5.2.7 on 2026-03-13 02:08

import django.db.models.deletion
import mojo.models.rest
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('account', '0031_user_requires_mfa'),
    ]

    operations = [
        migrations.CreateModel(
            name='Notification',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('modified', models.DateTimeField(auto_now=True, db_index=True)),
                ('title', models.CharField(max_length=200)),
                ('body', models.TextField(blank=True, default='')),
                ('kind', models.CharField(db_index=True, default='general', max_length=80)),
                ('data', models.JSONField(blank=True, default=dict)),
                ('action_url', models.CharField(blank=True, default=None, max_length=500, null=True)),
                ('is_unread', models.BooleanField(db_index=True, default=True)),
                ('expires_at', models.DateTimeField(blank=True, db_index=True, default=None, null=True)),
                ('group', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='notifications', to='account.group')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='notifications', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-created'],
                'indexes': [models.Index(fields=['user', 'is_unread'], name='account_not_user_id_9cfaec_idx'), models.Index(fields=['user', 'created'], name='account_not_user_id_d6abc6_idx')],
            },
            bases=(models.Model, mojo.models.rest.MojoModel),
        ),
    ]
