moviewyrm/bookwyrm/migrations/0049_auto_20210309_0156.py

114 lines
3.7 KiB
Python
Raw Normal View History

2021-03-09 02:36:34 +00:00
# Generated by Django 3.0.7 on 2021-03-09 01:56
2021-03-09 01:16:59 +00:00
import bookwyrm.models.fields
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
2021-03-09 02:36:34 +00:00
import django.db.models.expressions
2021-03-09 01:16:59 +00:00
class Migration(migrations.Migration):
dependencies = [
2021-03-09 20:57:38 +00:00
("bookwyrm", "0048_merge_20210308_1754"),
2021-03-09 01:16:59 +00:00
]
operations = [
migrations.CreateModel(
2021-03-09 20:57:38 +00:00
name="Report",
2021-03-09 01:16:59 +00:00
fields=[
2021-03-09 20:57:38 +00:00
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("created_date", models.DateTimeField(auto_now_add=True)),
("updated_date", models.DateTimeField(auto_now=True)),
(
"remote_id",
bookwyrm.models.fields.RemoteIdField(
max_length=255,
null=True,
validators=[bookwyrm.models.fields.validate_remote_id],
),
),
("note", models.TextField(blank=True, null=True)),
("resolved", models.BooleanField(default=False)),
(
"reporter",
models.ForeignKey(
on_delete=django.db.models.deletion.PROTECT,
related_name="reporter",
to=settings.AUTH_USER_MODEL,
),
),
(
"statuses",
models.ManyToManyField(blank=True, null=True, to="bookwyrm.Status"),
),
(
"user",
models.ForeignKey(
on_delete=django.db.models.deletion.PROTECT,
to=settings.AUTH_USER_MODEL,
),
),
2021-03-09 01:16:59 +00:00
],
),
migrations.CreateModel(
2021-03-09 20:57:38 +00:00
name="ReportComment",
2021-03-09 01:16:59 +00:00
fields=[
2021-03-09 20:57:38 +00:00
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("created_date", models.DateTimeField(auto_now_add=True)),
("updated_date", models.DateTimeField(auto_now=True)),
(
"remote_id",
bookwyrm.models.fields.RemoteIdField(
max_length=255,
null=True,
validators=[bookwyrm.models.fields.validate_remote_id],
),
),
("note", models.TextField()),
(
"report",
models.ForeignKey(
on_delete=django.db.models.deletion.PROTECT,
to="bookwyrm.Report",
),
),
(
"user",
models.ForeignKey(
on_delete=django.db.models.deletion.PROTECT,
to=settings.AUTH_USER_MODEL,
),
),
2021-03-09 01:16:59 +00:00
],
options={
2021-03-09 20:57:38 +00:00
"abstract": False,
2021-03-09 01:16:59 +00:00
},
),
2021-03-09 02:36:34 +00:00
migrations.AddConstraint(
2021-03-09 20:57:38 +00:00
model_name="report",
constraint=models.CheckConstraint(
check=models.Q(
_negated=True, reporter=django.db.models.expressions.F("user")
),
name="self_report",
),
2021-03-09 02:36:34 +00:00
),
2021-03-09 01:16:59 +00:00
]