# Generated by Django 6.0.2 on 2026-02-09 09:44

import blueprint.fields
import blueprint.media_library.fields
import blueprint.media_library.models
import django.core.validators
import uuid
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="Folder",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    "created_at",
                    models.DateTimeField(auto_now_add=True, verbose_name="Created at"),
                ),
                (
                    "modified_at",
                    models.DateTimeField(auto_now=True, verbose_name="Modified at"),
                ),
                (
                    "name",
                    models.CharField(
                        max_length=100,
                        validators=[django.core.validators.MinLengthValidator(1)],
                        verbose_name="Name",
                    ),
                ),
            ],
            options={
                "verbose_name": "Folder",
                "verbose_name_plural": "Folders",
                "db_table": "dbp_folder",
                "ordering": ["-created_at"],
                "get_latest_by": "created_at",
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="Media",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    "created_at",
                    models.DateTimeField(auto_now_add=True, verbose_name="Created at"),
                ),
                (
                    "modified_at",
                    models.DateTimeField(auto_now=True, verbose_name="Modified at"),
                ),
                (
                    "file",
                    models.FileField(
                        upload_to=blueprint.media_library.models.generate_uuid,
                        verbose_name="File",
                    ),
                ),
                (
                    "name",
                    models.CharField(
                        blank=True, default="", max_length=255, verbose_name="Name"
                    ),
                ),
                (
                    "alt_text",
                    models.CharField(
                        blank=True,
                        default="",
                        help_text="Describes a picture for screen readers",
                        max_length=255,
                        verbose_name="Alt tekst",
                    ),
                ),
                ("tags", blueprint.fields.TagField(default=list, verbose_name="Tags")),
                (
                    "crop",
                    blueprint.media_library.fields.CropField(
                        blank=True, default=list, verbose_name="Crop"
                    ),
                ),
                (
                    "size",
                    models.PositiveIntegerField(
                        editable=False, null=True, verbose_name="File size"
                    ),
                ),
                (
                    "type",
                    models.CharField(
                        choices=[
                            ("image", "Image"),
                            ("video", "Video"),
                            ("audio", "Audio"),
                            ("file", "File"),
                        ],
                        default="file",
                        max_length=20,
                        verbose_name="File type",
                    ),
                ),
            ],
            options={
                "verbose_name": "Media",
                "verbose_name_plural": "Media",
                "db_table": "dbp_media",
                "ordering": ["-created_at"],
                "get_latest_by": "created_at",
                "abstract": False,
            },
        ),
    ]
