# Generated by Django 5.2.4 on 2025-07-14 22:14

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

import flatpages_extra.models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("flatpages", "0001_initial"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name="FlatPage",
            fields=[],
            options={
                "proxy": True,
                "indexes": [],
                "constraints": [],
            },
            bases=("flatpages.flatpage",),
        ),
        migrations.CreateModel(
            name="Revision",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("content", models.TextField(blank=True, verbose_name="content")),
                (
                    "previous_content",
                    models.TextField(
                        blank=True, editable=False, verbose_name="content"
                    ),
                ),
                (
                    "description",
                    models.TextField(
                        help_text="Describe the changes you've made. Future you will be thankful.",
                        verbose_name="Description of the change",
                    ),
                ),
                (
                    "status",
                    models.IntegerField(
                        choices=[(1, "Unpublished"), (2, "Published"), (3, "Reverted")],
                        default=1,
                        editable=False,
                    ),
                ),
                ("created_on", models.DateTimeField(auto_now_add=True)),
                ("updated_on", models.DateTimeField(auto_now=True)),
                (
                    "published_on",
                    models.DateTimeField(blank=True, editable=False, null=True),
                ),
                (
                    "reverted_on",
                    models.DateTimeField(blank=True, editable=False, null=True),
                ),
                (
                    "share_key",
                    models.CharField(
                        default=flatpages_extra.models.get_random_share_key,
                        editable=False,
                        max_length=10,
                    ),
                ),
                ("authors", models.ManyToManyField(to=settings.AUTH_USER_MODEL)),
                (
                    "page",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="changes",
                        to="flatpages_extra.flatpage",
                    ),
                ),
            ],
            options={
                "ordering": ("-updated_on",),
            },
        ),
    ]
