# Generated by Django 2.2.12 on 2020-06-01 19:35

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name="ContentSetting",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=200, unique=True)),
                ("value", models.TextField(blank=True)),
                ("version", models.CharField(max_length=50, null=True)),
            ],
            options={"ordering": ("name",)},
        ),
        migrations.CreateModel(
            name="HistoryContentSetting",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("created_on", models.DateTimeField(default=django.utils.timezone.now)),
                ("name", models.CharField(max_length=200)),
                ("value", models.TextField(blank=True, null=True)),
                ("version", models.CharField(max_length=50, null=True)),
                (
                    "was_changed",
                    models.BooleanField(
                        choices=[
                            (True, "Changed"),
                            (False, "Added"),
                            (None, "Removed"),
                        ],
                        default=True,
                        null=True,
                    ),
                ),
                (
                    "by_user",
                    models.BooleanField(
                        choices=[
                            (True, "by user"),
                            (False, "by app"),
                            (None, "unknown"),
                        ],
                        default=None,
                        null=True,
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "ordering": ("-id",),
            },
        ),
        migrations.CreateModel(
            name="UserTagSetting",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=200)),
                ("tag", models.TextField()),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "unique_together": {("user", "name", "tag")},
            },
        ),
        migrations.AddIndex(
            model_name="historycontentsetting",
            index=models.Index(
                fields=["name", "-id"], name="static_cont_name_d40020_idx"
            ),
        ),
    ]
