# Generated by Django 5.2.3 on 2025-11-02 13:12 import django.db.models.deletion import uuid from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('notifications', '0001_initial'), migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='Notification', fields=[ ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False, verbose_name='ID')), ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created At')), ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Updated At')), ('title', models.CharField(max_length=200, verbose_name='Title')), ('message', models.TextField(verbose_name='Message')), ('notification_type', models.CharField(choices=[('INFO', 'Info'), ('SUCCESS', 'Success'), ('WARNING', 'Warning'), ('ERROR', 'Error')], default='INFO', max_length=20, verbose_name='Notification Type')), ('is_read', models.BooleanField(default=False, verbose_name='Is Read')), ('read_at', models.DateTimeField(blank=True, null=True, verbose_name='Read At')), ('related_object_type', models.CharField(blank=True, help_text="Type of related object (e.g., 'appointment', 'invoice')", max_length=50, verbose_name='Related Object Type')), ('related_object_id', models.UUIDField(blank=True, help_text='UUID of related object', null=True, verbose_name='Related Object ID')), ('action_url', models.CharField(blank=True, help_text='URL to navigate to when notification is clicked', max_length=500, verbose_name='Action URL')), ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='notifications', to=settings.AUTH_USER_MODEL, verbose_name='User')), ], options={ 'verbose_name': 'Notification', 'verbose_name_plural': 'Notifications', 'ordering': ['-created_at'], 'indexes': [models.Index(fields=['user', 'is_read', 'created_at'], name='notificatio_user_id_8a7c6b_idx'), models.Index(fields=['user', 'created_at'], name='notificatio_user_id_c62b26_idx'), models.Index(fields=['notification_type', 'created_at'], name='notificatio_notific_f2e0f7_idx'), models.Index(fields=['related_object_type', 'related_object_id'], name='notificatio_related_f82ec2_idx')], }, ), ]