# Generated by Django 3.2.5 on 2021-12-16 00:20

import bookwyrm.models.activitypub_mixin
import bookwyrm.models.fields
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        ("bookwyrm", "0120_list_embed_key"),
    ]

    operations = [
        migrations.CreateModel(
            name="Link",
            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],
                    ),
                ),
                ("url", bookwyrm.models.fields.URLField(max_length=255)),
                ("name", bookwyrm.models.fields.CharField(max_length=255)),
            ],
            options={
                "abstract": False,
            },
            bases=(bookwyrm.models.activitypub_mixin.ActivitypubMixin, models.Model),
        ),
        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)),
                (
                    "book",
                    bookwyrm.models.fields.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="file_links",
                        to="bookwyrm.book",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=("bookwyrm.link",),
        ),
    ]
