# Generated by Django 2.0.8 on 2018-09-04 20:11

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [("federation", "0009_auto_20180822_1956")]

    operations = [
        migrations.CreateModel(
            name="InboxItem",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("is_delivered", models.BooleanField(default=False)),
                (
                    "type",
                    models.CharField(
                        choices=[("to", "to"), ("cc", "cc")], max_length=10
                    ),
                ),
                ("last_delivery_date", models.DateTimeField(blank=True, null=True)),
                ("delivery_attempts", models.PositiveIntegerField(default=0)),
            ],
        ),
        migrations.RemoveField(model_name="activity", name="delivered"),
        migrations.RemoveField(model_name="activity", name="delivered_date"),
        migrations.RemoveField(model_name="activity", name="recipient"),
        migrations.AlterField(
            model_name="activity",
            name="actor",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="outbox_activities",
                to="federation.Actor",
            ),
        ),
        migrations.AddField(
            model_name="inboxitem",
            name="activity",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="inbox_items",
                to="federation.Activity",
            ),
        ),
        migrations.AddField(
            model_name="inboxitem",
            name="actor",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="inbox_items",
                to="federation.Actor",
            ),
        ),
        migrations.AddField(
            model_name="activity",
            name="recipients",
            field=models.ManyToManyField(
                related_name="inbox_activities",
                through="federation.InboxItem",
                to="federation.Actor",
            ),
        ),
    ]
