2021-05-31 09:20:38 +00:00
|
|
|
# Generated by Django 3.1 on 2021-05-31 08:59
|
|
|
|
|
|
|
|
from django.conf import settings
|
|
|
|
from django.db import migrations, models
|
|
|
|
import django.db.models.deletion
|
|
|
|
import uuid
|
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
|
|
|
initial = True
|
|
|
|
|
|
|
|
dependencies = [
|
|
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
|
|
('users', '0035_auto_20210526_1100'),
|
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
|
|
|
migrations.CreateModel(
|
2021-06-15 06:01:57 +00:00
|
|
|
name='SiteMessage',
|
2021-05-31 09:20:38 +00:00
|
|
|
fields=[
|
|
|
|
('created_by', models.CharField(blank=True, max_length=32, null=True, verbose_name='Created by')),
|
|
|
|
('updated_by', models.CharField(blank=True, max_length=32, null=True, verbose_name='Updated by')),
|
|
|
|
('date_created', models.DateTimeField(auto_now_add=True, null=True, verbose_name='Date created')),
|
|
|
|
('date_updated', models.DateTimeField(auto_now=True, verbose_name='Date updated')),
|
|
|
|
('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
|
|
|
|
('subject', models.CharField(max_length=1024)),
|
|
|
|
('message', models.TextField()),
|
|
|
|
('is_broadcast', models.BooleanField(default=False)),
|
|
|
|
('groups', models.ManyToManyField(to='users.UserGroup')),
|
|
|
|
('sender', models.ForeignKey(db_constraint=False, default=None, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='send_site_message', to=settings.AUTH_USER_MODEL)),
|
|
|
|
],
|
|
|
|
options={
|
|
|
|
'abstract': False,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='UserMsgSubscription',
|
|
|
|
fields=[
|
|
|
|
('created_by', models.CharField(blank=True, max_length=32, null=True, verbose_name='Created by')),
|
|
|
|
('updated_by', models.CharField(blank=True, max_length=32, null=True, verbose_name='Updated by')),
|
|
|
|
('date_created', models.DateTimeField(auto_now_add=True, null=True, verbose_name='Date created')),
|
|
|
|
('date_updated', models.DateTimeField(auto_now=True, verbose_name='Date updated')),
|
|
|
|
('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
|
|
|
|
('message_type', models.CharField(max_length=128)),
|
2022-11-04 06:22:38 +00:00
|
|
|
('receive_backends', models.JSONField(default=list, verbose_name='receive backend')),
|
2021-09-09 12:12:52 +00:00
|
|
|
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user_msg_subscription', to=settings.AUTH_USER_MODEL)),
|
2021-05-31 09:20:38 +00:00
|
|
|
],
|
|
|
|
options={
|
2022-11-04 06:22:38 +00:00
|
|
|
'abstract': False, 'verbose_name': 'User message'
|
2021-05-31 09:20:38 +00:00
|
|
|
},
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='SystemMsgSubscription',
|
|
|
|
fields=[
|
|
|
|
('created_by', models.CharField(blank=True, max_length=32, null=True, verbose_name='Created by')),
|
|
|
|
('updated_by', models.CharField(blank=True, max_length=32, null=True, verbose_name='Updated by')),
|
|
|
|
('date_created', models.DateTimeField(auto_now_add=True, null=True, verbose_name='Date created')),
|
|
|
|
('date_updated', models.DateTimeField(auto_now=True, verbose_name='Date updated')),
|
|
|
|
('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
|
|
|
|
('message_type', models.CharField(max_length=128, unique=True)),
|
|
|
|
('receive_backends', models.JSONField(default=list)),
|
|
|
|
('groups', models.ManyToManyField(related_name='system_msg_subscriptions', to='users.UserGroup')),
|
|
|
|
('users', models.ManyToManyField(related_name='system_msg_subscriptions', to=settings.AUTH_USER_MODEL)),
|
|
|
|
],
|
|
|
|
options={
|
2022-11-04 06:22:38 +00:00
|
|
|
'abstract': False, 'verbose_name': 'System message'
|
2021-05-31 09:20:38 +00:00
|
|
|
},
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='SiteMessageUsers',
|
|
|
|
fields=[
|
|
|
|
('created_by', models.CharField(blank=True, max_length=32, null=True, verbose_name='Created by')),
|
|
|
|
('updated_by', models.CharField(blank=True, max_length=32, null=True, verbose_name='Updated by')),
|
|
|
|
('date_created', models.DateTimeField(auto_now_add=True, null=True, verbose_name='Date created')),
|
|
|
|
('date_updated', models.DateTimeField(auto_now=True, verbose_name='Date updated')),
|
|
|
|
('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
|
|
|
|
('has_read', models.BooleanField(default=False)),
|
|
|
|
('read_at', models.DateTimeField(default=None, null=True)),
|
|
|
|
('sitemessage', models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.CASCADE, related_name='m2m_sitemessageusers', to='notifications.sitemessage')),
|
|
|
|
('user', models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.CASCADE, related_name='m2m_sitemessageusers', to=settings.AUTH_USER_MODEL)),
|
|
|
|
],
|
|
|
|
options={
|
|
|
|
'abstract': False,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name='sitemessage',
|
|
|
|
name='users',
|
|
|
|
field=models.ManyToManyField(related_name='recv_site_messages', through='notifications.SiteMessageUsers', to=settings.AUTH_USER_MODEL),
|
|
|
|
),
|
|
|
|
]
|