2021-02-10 21:15:12 +00:00
|
|
|
# Generated by Django 3.0.7 on 2021-02-10 21:14
|
|
|
|
|
|
|
|
from django.conf import settings
|
|
|
|
from django.db import migrations, models
|
|
|
|
import django.db.models.deletion
|
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
|
|
|
dependencies = [
|
2021-03-08 16:49:10 +00:00
|
|
|
("bookwyrm", "0044_auto_20210207_1924"),
|
2021-02-10 21:15:12 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
|
|
|
migrations.RemoveConstraint(
|
2021-03-08 16:49:10 +00:00
|
|
|
model_name="notification",
|
|
|
|
name="notification_type_valid",
|
2021-02-10 21:15:12 +00:00
|
|
|
),
|
|
|
|
migrations.AddField(
|
2021-03-08 16:49:10 +00:00
|
|
|
model_name="notification",
|
|
|
|
name="related_list_item",
|
|
|
|
field=models.ForeignKey(
|
|
|
|
null=True,
|
|
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
|
|
to="bookwyrm.ListItem",
|
|
|
|
),
|
2021-02-10 21:15:12 +00:00
|
|
|
),
|
|
|
|
migrations.AlterField(
|
2021-03-08 16:49:10 +00:00
|
|
|
model_name="notification",
|
|
|
|
name="notification_type",
|
|
|
|
field=models.CharField(
|
|
|
|
choices=[
|
|
|
|
("FAVORITE", "Favorite"),
|
|
|
|
("REPLY", "Reply"),
|
|
|
|
("MENTION", "Mention"),
|
|
|
|
("TAG", "Tag"),
|
|
|
|
("FOLLOW", "Follow"),
|
|
|
|
("FOLLOW_REQUEST", "Follow Request"),
|
|
|
|
("BOOST", "Boost"),
|
|
|
|
("IMPORT", "Import"),
|
|
|
|
("ADD", "Add"),
|
|
|
|
],
|
|
|
|
max_length=255,
|
|
|
|
),
|
2021-02-10 21:15:12 +00:00
|
|
|
),
|
|
|
|
migrations.AlterField(
|
2021-03-08 16:49:10 +00:00
|
|
|
model_name="notification",
|
|
|
|
name="related_book",
|
|
|
|
field=models.ForeignKey(
|
|
|
|
null=True,
|
|
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
|
|
to="bookwyrm.Edition",
|
|
|
|
),
|
2021-02-10 21:15:12 +00:00
|
|
|
),
|
|
|
|
migrations.AlterField(
|
2021-03-08 16:49:10 +00:00
|
|
|
model_name="notification",
|
|
|
|
name="related_import",
|
|
|
|
field=models.ForeignKey(
|
|
|
|
null=True,
|
|
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
|
|
to="bookwyrm.ImportJob",
|
|
|
|
),
|
2021-02-10 21:15:12 +00:00
|
|
|
),
|
|
|
|
migrations.AlterField(
|
2021-03-08 16:49:10 +00:00
|
|
|
model_name="notification",
|
|
|
|
name="related_status",
|
|
|
|
field=models.ForeignKey(
|
|
|
|
null=True,
|
|
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
|
|
to="bookwyrm.Status",
|
|
|
|
),
|
2021-02-10 21:15:12 +00:00
|
|
|
),
|
|
|
|
migrations.AlterField(
|
2021-03-08 16:49:10 +00:00
|
|
|
model_name="notification",
|
|
|
|
name="related_user",
|
|
|
|
field=models.ForeignKey(
|
|
|
|
null=True,
|
|
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
|
|
related_name="related_user",
|
|
|
|
to=settings.AUTH_USER_MODEL,
|
|
|
|
),
|
2021-02-10 21:15:12 +00:00
|
|
|
),
|
|
|
|
migrations.AlterField(
|
2021-03-08 16:49:10 +00:00
|
|
|
model_name="notification",
|
|
|
|
name="user",
|
|
|
|
field=models.ForeignKey(
|
|
|
|
on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL
|
|
|
|
),
|
2021-02-10 21:15:12 +00:00
|
|
|
),
|
|
|
|
migrations.AddConstraint(
|
2021-03-08 16:49:10 +00:00
|
|
|
model_name="notification",
|
|
|
|
constraint=models.CheckConstraint(
|
|
|
|
check=models.Q(
|
|
|
|
notification_type__in=[
|
|
|
|
"FAVORITE",
|
|
|
|
"REPLY",
|
|
|
|
"MENTION",
|
|
|
|
"TAG",
|
|
|
|
"FOLLOW",
|
|
|
|
"FOLLOW_REQUEST",
|
|
|
|
"BOOST",
|
|
|
|
"IMPORT",
|
|
|
|
"ADD",
|
|
|
|
]
|
|
|
|
),
|
|
|
|
name="notification_type_valid",
|
|
|
|
),
|
2021-02-10 21:15:12 +00:00
|
|
|
),
|
|
|
|
]
|