moviewyrm/bookwyrm/migrations/0126_filelink_link_linkdomain.py

145 lines
4.9 KiB
Python
Raw Normal View History

# Generated by Django 3.2.10 on 2022-01-10 21:20
2021-10-07 23:53:39 +00:00
import bookwyrm.models.activitypub_mixin
import bookwyrm.models.fields
from django.conf import settings
2021-10-07 23:53:39 +00:00
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
2022-01-09 21:19:29 +00:00
("bookwyrm", "0125_alter_user_preferred_language"),
2021-10-07 23:53:39 +00:00
]
operations = [
migrations.CreateModel(
2022-01-09 22:21:13 +00:00
name="LinkDomain",
2021-10-07 23:53:39 +00:00
fields=[
(
"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],
),
),
2022-01-09 22:21:13 +00:00
("domain", models.CharField(max_length=255, unique=True)),
(
"status",
models.CharField(
choices=[
("approved", "Approved"),
("blocked", "Blocked"),
("pending", "Pending"),
],
default="pending",
max_length=50,
),
),
("name", models.CharField(max_length=100)),
(
"reported_by",
models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to=settings.AUTH_USER_MODEL,
),
),
2021-10-07 23:53:39 +00:00
],
options={
"abstract": False,
},
),
2022-01-09 21:19:29 +00:00
migrations.CreateModel(
2022-01-09 22:21:13 +00:00
name="Link",
2022-01-09 21:19:29 +00:00
fields=[
(
"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],
),
),
2022-01-09 22:21:13 +00:00
("url", bookwyrm.models.fields.URLField(max_length=255)),
(
"added_by",
bookwyrm.models.fields.ForeignKey(
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to=settings.AUTH_USER_MODEL,
),
),
2022-01-09 21:19:29 +00:00
(
2022-01-09 22:21:13 +00:00
"domain",
models.ForeignKey(
blank=True,
null=True,
2022-01-10 04:30:23 +00:00
on_delete=django.db.models.deletion.CASCADE,
2022-01-10 18:11:00 +00:00
related_name="links",
2022-01-09 22:21:13 +00:00
to="bookwyrm.linkdomain",
2022-01-09 21:19:29 +00:00
),
),
],
options={
"abstract": False,
},
2022-01-09 22:21:13 +00:00
bases=(bookwyrm.models.activitypub_mixin.ActivitypubMixin, models.Model),
2022-01-09 21:19:29 +00:00
),
2021-10-07 23:53:39 +00:00
migrations.CreateModel(
name="FileLink",
fields=[
(
"link_ptr",
models.OneToOneField(
auto_created=True,
on_delete=django.db.models.deletion.CASCADE,
parent_link=True,
primary_key=True,
serialize=False,
to="bookwyrm.link",
),
),
("filetype", bookwyrm.models.fields.CharField(max_length=5)),
2021-12-16 00:23:21 +00:00
(
"book",
2022-01-09 21:19:29 +00:00
models.ForeignKey(
2021-12-16 00:23:21 +00:00
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="file_links",
to="bookwyrm.book",
),
),
2021-10-07 23:53:39 +00:00
],
options={
"abstract": False,
},
bases=("bookwyrm.link",),
),
]