# Generated by Django 2.2.13 on 2020-08-11 14:56

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("contenttypes", "0002_remove_content_type_name"),
        ("barriers", "0080_auto_20200806_1333"),
    ]

    operations = [
        migrations.CreateModel(
            name="CachedHistoryItem",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("date", models.DateTimeField()),
                ("model", models.CharField(max_length=255)),
                ("field", models.CharField(max_length=255)),
                ("new_record_id", models.PositiveIntegerField(null=True)),
                ("old_record_id", models.PositiveIntegerField(null=True)),
                (
                    "barrier",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="cached_history_items",
                        to="barriers.BarrierInstance",
                    ),
                ),
                (
                    "new_record_content_type",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="new_record_history_items",
                        to="contenttypes.ContentType",
                    ),
                ),
                (
                    "old_record_content_type",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="old_record_history_items",
                        to="contenttypes.ContentType",
                    ),
                ),
            ],
            options={
                "ordering": ("date",),
            },
        ),
    ]
