agdar/notifications/migrations/0003_add_general_and_role_based_notifications.py
Marwan Alwali a4665842c9 update
2025-11-23 10:58:07 +03:00

32 lines
1.3 KiB
Python

# Generated by Django 5.2.3 on 2025-11-18 12:06
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('notifications', '0002_notification'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.AddField(
model_name='notification',
name='is_general',
field=models.BooleanField(default=False, help_text='If True, this notification is visible to all users (system-wide announcement)', verbose_name='Is General'),
),
migrations.AddField(
model_name='notification',
name='target_roles',
field=models.JSONField(blank=True, default=list, help_text="List of user roles that should see this notification (e.g., ['ADMIN', 'FRONT_DESK'])", verbose_name='Target Roles'),
),
migrations.AlterField(
model_name='notification',
name='user',
field=models.ForeignKey(blank=True, help_text='Specific user for personal notifications. Leave empty for general/role-based notifications.', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='notifications', to=settings.AUTH_USER_MODEL, verbose_name='User'),
),
]