2025-07-07 02:51:11 +00:00

47 lines
1.9 KiB
Python

# Generated by Django 5.1.6 on 2025-03-04 01:24
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
def create_permissions(apps, schema_editor) -> None:
# Remnant of AAv0
User = apps.get_model('auth', 'User')
ContentType = apps.get_model('contenttypes', 'ContentType')
Permission = apps.get_model('auth', 'Permission')
ct = ContentType.objects.get_for_model(User)
Permission.objects.get_or_create(codename="logging_notifications", content_type=ct, name="logging_notifications")
def reverse(apps, schema_editor) -> None:
pass
class Migration(migrations.Migration):
replaces = [('notifications', '0001_initial'), ('notifications', '0002_auto_20160910_1649'), ('notifications', '0003_make_strings_more_stringy'), ('notifications', '0004_performance_tuning'), ('notifications', '0005_fix_level_choices')]
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='Notification',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('level', models.CharField(choices=[('danger', 'danger'), ('warning', 'warning'), ('info', 'info'), ('success', 'success')], default='info', max_length=10)),
('title', models.CharField(max_length=254)),
('message', models.TextField()),
('timestamp', models.DateTimeField(auto_now_add=True, db_index=True)),
('viewed', models.BooleanField(db_index=True, default=False)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
options={'permissions': ()},
),
migrations.RunPython(create_permissions, reverse)
]