# Generated by Django 5.1.7 on 2025-06-26 09:26

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='NotificationCategory',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, unique=True)),
                ('description', models.TextField(blank=True)),
                ('color_code', models.CharField(default='#61b239', max_length=7)),
            ],
            options={
                'verbose_name_plural': 'Notification Categories',
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='NotificationTag',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, unique=True)),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='SiteStatistic',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, unique=True)),
                ('value', models.CharField(max_length=20)),
                ('description', models.TextField()),
                ('icon', models.CharField(blank=True, help_text='Icon class or name', max_length=50)),
                ('order', models.PositiveIntegerField(default=0)),
                ('is_active', models.BooleanField(default=True)),
            ],
            options={
                'ordering': ['order', 'name'],
            },
        ),
        migrations.CreateModel(
            name='Notification',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=255)),
                ('description', models.TextField(blank=True)),
                ('content', models.TextField(help_text='Full notification content')),
                ('published_date', models.DateTimeField(default=django.utils.timezone.now)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('priority', models.CharField(choices=[('low', 'Low'), ('medium', 'Medium'), ('high', 'High'), ('urgent', 'Urgent')], default='medium', max_length=10)),
                ('is_active', models.BooleanField(default=True)),
                ('is_featured', models.BooleanField(default=False, help_text='Show in featured/highlighted sections')),
                ('external_link', models.URLField(blank=True, help_text='External link for more details')),
                ('attachment', models.FileField(blank=True, null=True, upload_to='notifications/attachments/')),
                ('slug', models.SlugField(blank=True, max_length=255, unique=True)),
                ('meta_description', models.TextField(blank=True, max_length=160)),
                ('category', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='notifications', to='notifications.notificationcategory')),
            ],
            options={
                'ordering': ['-published_date', '-created_at'],
            },
        ),
        migrations.CreateModel(
            name='NotificationTagRelation',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('notification', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='notification_tags', to='notifications.notification')),
                ('tag', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tagged_notifications', to='notifications.notificationtag')),
            ],
        ),
        migrations.AddIndex(
            model_name='notification',
            index=models.Index(fields=['-published_date'], name='notificatio_publish_5a7564_idx'),
        ),
        migrations.AddIndex(
            model_name='notification',
            index=models.Index(fields=['is_active'], name='notificatio_is_acti_7de9ed_idx'),
        ),
        migrations.AddIndex(
            model_name='notification',
            index=models.Index(fields=['is_featured'], name='notificatio_is_feat_b2916f_idx'),
        ),
        migrations.AddIndex(
            model_name='notification',
            index=models.Index(fields=['category'], name='notificatio_categor_a0f58b_idx'),
        ),
        migrations.AlterUniqueTogether(
            name='notificationtagrelation',
            unique_together={('notification', 'tag')},
        ),
    ]
