# Generated by Django 6.0 on 2026-03-02 17:43

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('academics', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='AnnouncementType',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('code', models.CharField(max_length=50, unique=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('is_active', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'db_table': 'announcement_types',
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='ClassAnnouncement',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=255)),
                ('message', models.TextField()),
                ('expire_on', models.DateField(blank=True, null=True)),
                ('priority', models.CharField(choices=[('low', 'Low'), ('medium', 'Medium'), ('high', 'High')], default='medium', max_length=20)),
                ('created_by_external_user_id', models.IntegerField(blank=True, null=True)),
                ('from_role', models.CharField(blank=True, max_length=100, null=True)),
                ('is_active', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('academic_class', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='class_announcements', to='academics.academicclass')),
                ('announcement_type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='class_announcements', to='announcements.announcementtype')),
            ],
            options={
                'db_table': 'class_announcements',
                'ordering': ['-created_at'],
            },
        ),
        migrations.CreateModel(
            name='CommonAnnouncement',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=255)),
                ('message', models.TextField()),
                ('expire_on', models.DateField(blank=True, null=True)),
                ('priority', models.CharField(choices=[('low', 'Low'), ('medium', 'Medium'), ('high', 'High')], default='medium', max_length=20)),
                ('created_by_external_user_id', models.IntegerField(blank=True, null=True)),
                ('from_role', models.CharField(blank=True, max_length=100, null=True)),
                ('is_active', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('announcement_type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='common_announcements', to='announcements.announcementtype')),
            ],
            options={
                'db_table': 'common_announcements',
                'ordering': ['-created_at'],
            },
        ),
        migrations.CreateModel(
            name='StudentAnnouncement',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=255)),
                ('message', models.TextField()),
                ('section', models.CharField(blank=True, choices=[('nursery', 'Nursery'), ('primary', 'Primary'), ('higher_secondary', 'Higher Secondary')], max_length=20, null=True)),
                ('is_for_all_students', models.BooleanField(default=False)),
                ('expire_on', models.DateField(blank=True, null=True)),
                ('priority', models.CharField(choices=[('low', 'Low'), ('medium', 'Medium'), ('high', 'High')], default='medium', max_length=20)),
                ('created_by_external_user_id', models.IntegerField(blank=True, null=True)),
                ('from_role', models.CharField(blank=True, max_length=100, null=True)),
                ('is_active', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('academic_class', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='student_announcements', to='academics.academicclass')),
                ('announcement_type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='student_announcements', to='announcements.announcementtype')),
            ],
            options={
                'db_table': 'student_announcements',
                'ordering': ['-created_at'],
            },
        ),
        migrations.CreateModel(
            name='TeacherAnnouncement',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=255)),
                ('message', models.TextField()),
                ('department', models.CharField(blank=True, max_length=100, null=True)),
                ('is_for_all_teachers', models.BooleanField(default=True)),
                ('expire_on', models.DateField(blank=True, null=True)),
                ('priority', models.CharField(choices=[('low', 'Low'), ('medium', 'Medium'), ('high', 'High')], default='medium', max_length=20)),
                ('created_by_external_user_id', models.IntegerField(blank=True, null=True)),
                ('from_role', models.CharField(blank=True, max_length=100, null=True)),
                ('is_active', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('announcement_type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='teacher_announcements', to='announcements.announcementtype')),
            ],
            options={
                'db_table': 'teacher_announcements',
                'ordering': ['-created_at'],
            },
        ),
    ]
