# Generated by Django 4.2.29 on 2026-05-12 18:24

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Notification',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('type', models.CharField(choices=[('anomaly_disabled_user', '账号因异常被自动封禁'), ('anomaly_disabled_team', '团队因异常被自动封禁'), ('quota_warning', '额度即将耗尽'), ('system', '系统通知')], default='system', max_length=30, verbose_name='类型')),
                ('title', models.CharField(blank=True, default='', max_length=200, verbose_name='标题')),
                ('content', models.TextField(blank=True, default='', verbose_name='内容')),
                ('link_url', models.CharField(blank=True, default='', max_length=500, verbose_name='跳转链接')),
                ('is_read', models.BooleanField(db_index=True, default=False, verbose_name='已读')),
                ('created_at', models.DateTimeField(auto_now_add=True, db_index=True, verbose_name='创建时间')),
                ('recipient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='notifications', to=settings.AUTH_USER_MODEL, verbose_name='接收人')),
            ],
            options={
                'verbose_name': '站内通知',
                'verbose_name_plural': '站内通知',
                'ordering': ['-created_at'],
                'indexes': [models.Index(fields=['recipient', 'is_read', '-created_at'], name='notificatio_recipie_684eac_idx')],
            },
        ),
    ]
