# Generated by Django 5.2.9 on 2026-01-06 20:07

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


class Migration(migrations.Migration):

    dependencies = [
        ("content", "0004_webrequestsampler_webrequeststep_websample_and_more"),
        ("groups", "0002_initial"),
        ("video", "0003_mjpegstream"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.AddField(
            model_name="videodevice",
            name="group",
            field=models.ForeignKey(
                blank=True,
                help_text="Security group that owns this object.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="+",
                to="groups.securitygroup",
            ),
        ),
        migrations.AddField(
            model_name="videodevice",
            name="user",
            field=models.ForeignKey(
                blank=True,
                help_text="User that owns this object.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="+",
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        migrations.CreateModel(
            name="VideoSnapshot",
            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)),
                (
                    "captured_at",
                    models.DateTimeField(default=django.utils.timezone.now),
                ),
                ("width", models.PositiveIntegerField(blank=True, null=True)),
                ("height", models.PositiveIntegerField(blank=True, null=True)),
                ("image_format", models.CharField(blank=True, max_length=50)),
                (
                    "device",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="snapshots",
                        to="video.videodevice",
                    ),
                ),
                (
                    "sample",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="video_snapshots",
                        to="content.contentsample",
                    ),
                ),
            ],
            options={
                "verbose_name": "Video Snapshot",
                "verbose_name_plural": "Video Snapshots",
                "ordering": ["-captured_at", "-id"],
            },
        ),
    ]
