OpenSlides/server/openslides/chat/migrations/0001_initial.py

74 lines
2.3 KiB
Python
Raw Normal View History

2020-12-04 06:51:01 +01:00
# Generated by Django 2.2.15 on 2020-12-03 12:52
from django.db import migrations, models
import openslides.utils.models
class Migration(migrations.Migration):
initial = True
dependencies = [
("users", "0015_user_vote_delegated_to"),
]
operations = [
migrations.CreateModel(
name="ChatGroup",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("name", models.CharField(max_length=256)),
(
"access_groups",
models.ManyToManyField(
blank=True, related_name="chat_access_groups", to="users.Group"
),
),
],
options={
"permissions": (("can_manage", "Can manage chat"),),
"default_permissions": (),
},
bases=(openslides.utils.models.RESTModelMixin, models.Model),
),
migrations.CreateModel(
name="ChatMessage",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("text", models.CharField(max_length=512)),
("timestamp", models.DateTimeField(auto_now_add=True)),
("username", models.CharField(max_length=256)),
("user_id", models.IntegerField()),
2020-12-04 06:51:01 +01:00
(
"chatgroup",
models.ForeignKey(
on_delete=openslides.utils.models.CASCADE_AND_AUTOUPDATE,
related_name="messages",
to="chat.ChatGroup",
),
),
],
options={
"default_permissions": (),
},
bases=(openslides.utils.models.RESTModelMixin, models.Model),
),
]