# Generated by Django 4.2.16 on 2024-10-05 00:21

from django.db import migrations, models
import django.db.models.deletion
import markdownx.models
import taggit.managers


class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="ArticleUpload",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("upload", models.FileField(upload_to="uploads/%Y/%m/%d/")),
            ],
            options={
                "verbose_name": "DjangoHelp Article Upload",
                "verbose_name_plural": "DjangoHelp Article Uploads",
                "managed": False,
            },
        ),
        migrations.CreateModel(
            name="DjangoHelpArticle",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                (
                    "title_en",
                    models.CharField(
                        blank=True, help_text="The title of this article.", max_length=30, verbose_name="Title"
                    ),
                ),
                (
                    "title_es",
                    models.CharField(
                        blank=True, help_text="The title of this article.", max_length=30, verbose_name="Title"
                    ),
                ),
                (
                    "title_fr",
                    models.CharField(
                        blank=True, help_text="The title of this article.", max_length=30, verbose_name="Title"
                    ),
                ),
                (
                    "subtitle_en",
                    models.CharField(
                        blank=True, help_text="A subtitle for this article.", max_length=70, verbose_name="Subtitle"
                    ),
                ),
                (
                    "subtitle_es",
                    models.CharField(
                        blank=True, help_text="A subtitle for this article.", max_length=70, verbose_name="Subtitle"
                    ),
                ),
                (
                    "subtitle_fr",
                    models.CharField(
                        blank=True, help_text="A subtitle for this article.", max_length=70, verbose_name="Subtitle"
                    ),
                ),
                (
                    "slug",
                    models.SlugField(
                        help_text="A web address friendly version of the title.", unique=True, verbose_name="Slug"
                    ),
                ),
                (
                    "article_content_en",
                    markdownx.models.MarkdownxField(
                        blank=True,
                        help_text="The content of this article. Markdown is supported.",
                        verbose_name="Article Content",
                    ),
                ),
                (
                    "article_content_es",
                    markdownx.models.MarkdownxField(
                        blank=True,
                        help_text="The content of this article. Markdown is supported.",
                        verbose_name="Article Content",
                    ),
                ),
                (
                    "article_content_fr",
                    markdownx.models.MarkdownxField(
                        blank=True,
                        help_text="The content of this article. Markdown is supported.",
                        verbose_name="Article Content",
                    ),
                ),
                (
                    "views",
                    models.PositiveIntegerField(
                        default=0, help_text="The number of times this article has been viewed."
                    ),
                ),
                (
                    "icon",
                    models.CharField(
                        blank=True,
                        default="fa-circle-info text-success",
                        help_text="The icon and text color to use for this article.",
                        max_length=50,
                    ),
                ),
                ("public", models.BooleanField(default=True, help_text="Check this box to make this article public.")),
                (
                    "highlighted",
                    models.BooleanField(
                        default=False, help_text="Check this box to highlight this article on the index page."
                    ),
                ),
                (
                    "intended_entity_type",
                    models.CharField(
                        choices=[("any", "Any")],
                        default="any",
                        help_text="The type of entity this article applies to.",
                        max_length=20,
                    ),
                ),
                ("created", models.DateTimeField(auto_now_add=True)),
                ("modified", models.DateTimeField(auto_now=True)),
            ],
            options={
                "verbose_name": "DjangoHelp Article",
                "verbose_name_plural": "DjangoHelp Articles",
                "ordering": ["title_en"],
            },
        ),
        migrations.CreateModel(
            name="Tag",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("name", models.CharField(max_length=100, unique=True, verbose_name="name")),
                ("slug", models.SlugField(allow_unicode=True, max_length=100, unique=True, verbose_name="slug")),
            ],
            options={
                "verbose_name": "tag",
                "verbose_name_plural": "tags",
            },
        ),
        migrations.CreateModel(
            name="TaggedArticles",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                (
                    "content_object",
                    models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="django_help.djangohelparticle"),
                ),
                (
                    "tag",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="%(app_label)s_%(class)s_items",
                        to="django_help.tag",
                    ),
                ),
            ],
            options={
                "verbose_name": "Tagged Article",
                "verbose_name_plural": "Tagged Articles",
            },
        ),
        migrations.CreateModel(
            name="DjangoHelpCategory",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                (
                    "title_en",
                    models.CharField(
                        blank=True, help_text="The title of this category.", max_length=30, verbose_name="Title"
                    ),
                ),
                (
                    "title_es",
                    models.CharField(
                        blank=True, help_text="The title of this category.", max_length=30, verbose_name="Title"
                    ),
                ),
                (
                    "title_fr",
                    models.CharField(
                        blank=True, help_text="The title of this category.", max_length=30, verbose_name="Title"
                    ),
                ),
                (
                    "subtitle_en",
                    models.CharField(
                        blank=True, help_text="A subtitle for this category.", max_length=70, verbose_name="Subtitle"
                    ),
                ),
                (
                    "subtitle_es",
                    models.CharField(
                        blank=True, help_text="A subtitle for this category.", max_length=70, verbose_name="Subtitle"
                    ),
                ),
                (
                    "subtitle_fr",
                    models.CharField(
                        blank=True, help_text="A subtitle for this category.", max_length=70, verbose_name="Subtitle"
                    ),
                ),
                (
                    "slug",
                    models.SlugField(
                        help_text="A web address friendly version of the title.", unique=True, verbose_name="Slug"
                    ),
                ),
                (
                    "description_en",
                    models.CharField(
                        blank=True,
                        help_text="A description of this category.",
                        max_length=200,
                        verbose_name="Description",
                    ),
                ),
                (
                    "description_es",
                    models.CharField(
                        blank=True,
                        help_text="A description of this category.",
                        max_length=200,
                        verbose_name="Description",
                    ),
                ),
                (
                    "description_fr",
                    models.CharField(
                        blank=True,
                        help_text="A description of this category.",
                        max_length=200,
                        verbose_name="Description",
                    ),
                ),
                (
                    "icon",
                    models.CharField(
                        blank=True,
                        default="fa-circle-info text-success",
                        help_text="The icon and text color to use for this category.",
                        max_length=50,
                    ),
                ),
                ("public", models.BooleanField(default=True, help_text="Check this box to make this category public.")),
                (
                    "intended_entity_type",
                    models.CharField(
                        choices=[("any", "Any")],
                        default="any",
                        help_text="The type of entity this category applies to.",
                        max_length=20,
                    ),
                ),
                ("created", models.DateTimeField(auto_now_add=True)),
                ("modified", models.DateTimeField(auto_now=True)),
            ],
            options={
                "verbose_name": "DjangoHelp Category",
                "verbose_name_plural": "DjangoHelp Categories",
                "ordering": ["title_en"],
                "indexes": [models.Index(fields=["slug"], name="django_help_slug_57ad1a_idx")],
            },
        ),
        migrations.AddField(
            model_name="djangohelparticle",
            name="category",
            field=models.ForeignKey(
                blank=True,
                help_text="The category this article belongs to, if any.",
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="articles",
                to="django_help.djangohelpcategory",
            ),
        ),
        migrations.AddField(
            model_name="djangohelparticle",
            name="tags",
            field=taggit.managers.TaggableManager(
                blank=True,
                help_text="A comma-separated list of tags.",
                through="django_help.TaggedArticles",
                to="django_help.Tag",
                verbose_name="Tags",
            ),
        ),
        migrations.CreateModel(
            name="RelevantPath",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                (
                    "path",
                    models.CharField(
                        help_text="The relevant path for this article. Wildcards are supported.", max_length=200
                    ),
                ),
                (
                    "article",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="relevant_paths",
                        to="django_help.djangohelparticle",
                    ),
                ),
            ],
            options={
                "verbose_name": "Relevant Path",
                "verbose_name_plural": "Relevant Paths",
                "ordering": ["path"],
                "indexes": [models.Index(fields=["path"], name="django_help_path_e58f80_idx")],
            },
        ),
        migrations.AddIndex(
            model_name="djangohelparticle",
            index=models.Index(fields=["slug"], name="django_help_slug_97cf18_idx"),
        ),
    ]
