# Generated by Django 5.2.8 on 2025-12-06 15:03

from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="WikimediaBridge",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("is_seed_data", models.BooleanField(default=False, editable=False)),
                ("is_user_data", models.BooleanField(default=False, editable=False)),
                ("is_deleted", models.BooleanField(default=False, editable=False)),
                (
                    "slug",
                    models.SlugField(
                        help_text="Identifier for this wiki.",
                        max_length=100,
                        unique=True,
                        verbose_name="Slug",
                    ),
                ),
                ("name", models.CharField(max_length=100, verbose_name="Name")),
                (
                    "api_endpoint",
                    models.URLField(
                        default="https://en.wikipedia.org/w/api.php",
                        help_text="Base Wikimedia API endpoint (usually https://<domain>/w/api.php).",
                        verbose_name="API endpoint",
                    ),
                ),
                (
                    "language_code",
                    models.CharField(
                        default="en",
                        help_text="Language for requests against the wiki.",
                        max_length=8,
                        verbose_name="Language code",
                    ),
                ),
                (
                    "user_agent",
                    models.CharField(
                        default="ArthexisAdminWikiHelper/1.0 (+https://arthexis.com)",
                        help_text="User agent sent with Wikimedia requests.",
                        max_length=255,
                        verbose_name="User agent",
                    ),
                ),
                (
                    "timeout",
                    models.PositiveIntegerField(
                        default=5,
                        help_text="Maximum time to wait for Wikimedia responses.",
                        verbose_name="Timeout (seconds)",
                    ),
                ),
                (
                    "cache_timeout",
                    models.PositiveIntegerField(
                        default=43200,
                        help_text="How long to cache fetched wiki entries.",
                        verbose_name="Cache timeout (seconds)",
                    ),
                ),
            ],
            options={
                "verbose_name": "Wikimedia bridge",
                "verbose_name_plural": "Wikimedia bridges",
                "db_table": "wikis_wikimedia_bridge",
                "ordering": ["name"],
            },
        ),
    ]
