31 lines
1.3 KiB
Python
31 lines
1.3 KiB
Python
# Generated by Django 5.2.4 on 2025-08-19 06:32
|
|
|
|
import django.db.models.deletion
|
|
from django.conf import settings
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('communications', '0003_alter_chat_department_alter_chat_participants'),
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='ChatReadState',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('last_read_at', models.DateTimeField(blank=True, null=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('chat', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='read_states', to='communications.chat')),
|
|
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='chat_read_states', to=settings.AUTH_USER_MODEL)),
|
|
],
|
|
options={
|
|
'indexes': [models.Index(fields=['chat', 'user'], name='communicati_chat_id_ac306b_idx'), models.Index(fields=['chat', 'last_read_at'], name='communicati_chat_id_edefdb_idx')],
|
|
'unique_together': {('chat', 'user')},
|
|
},
|
|
),
|
|
]
|