Add unique together for model
This commit is contained in:
parent
f3bed03d8f
commit
6b83a1ff0d
3 changed files with 38 additions and 0 deletions
18
chat_box/migrations/0010_auto_20221028_0300.py
Normal file
18
chat_box/migrations/0010_auto_20221028_0300.py
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
# Generated by Django 2.2.25 on 2022-10-27 20:00
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('judge', '0135_auto_20221028_0300'),
|
||||||
|
('chat_box', '0009_auto_20220618_1452'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterUniqueTogether(
|
||||||
|
name='userroom',
|
||||||
|
unique_together={('user', 'room')},
|
||||||
|
),
|
||||||
|
]
|
|
@ -55,6 +55,8 @@ class UserRoom(models.Model):
|
||||||
)
|
)
|
||||||
last_seen = models.DateTimeField(verbose_name=_("last seen"), auto_now_add=True)
|
last_seen = models.DateTimeField(verbose_name=_("last seen"), auto_now_add=True)
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
unique_together = ("user", "room")
|
||||||
|
|
||||||
class Ignore(models.Model):
|
class Ignore(models.Model):
|
||||||
user = models.OneToOneField(
|
user = models.OneToOneField(
|
||||||
|
|
18
judge/migrations/0135_auto_20221028_0300.py
Normal file
18
judge/migrations/0135_auto_20221028_0300.py
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue