# Generated by Django 5.2.18 on 2026-11-03 15:35

import django.db.models.deletion
import django.utils.timezone
import snapfile.core.fields
import snapfile.core.ids
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('projects', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Asset',
            fields=[
                ('id', snapfile.core.fields.UUIDv7Field(default=snapfile.core.ids.uuid7, editable=False, primary_key=True, serialize=False)),
                ('folder', models.CharField(blank=True, max_length=255, null=True)),
                ('name', models.CharField(max_length=255)),
                ('kind', models.CharField(default='image', max_length=16)),
                ('mime', models.CharField(max_length=64)),
                ('sha256', models.CharField(max_length=64)),
                ('size_bytes', models.PositiveIntegerField()),
                ('width_px', models.PositiveIntegerField(null=True)),
                ('height_px', models.PositiveIntegerField(null=True)),
                ('dpi', models.PositiveSmallIntegerField(null=True)),
                ('has_alpha', models.BooleanField(default=False)),
                ('color_space', models.CharField(max_length=16, null=True)),
                ('path', models.CharField(max_length=512)),
                ('variants', models.JSONField(blank=True, null=True)),
                ('source_url', models.CharField(blank=True, max_length=1024, null=True)),
                ('usage_count', models.IntegerField(default=0)),
                ('created_by', models.JSONField(blank=True, null=True)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
                ('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='assets', to='projects.project')),
            ],
            options={
                'db_table': 'assets',
                'indexes': [models.Index(fields=['project', 'id'], name='assets_project_id')],
                'constraints': [models.UniqueConstraint(fields=('project', 'sha256'), name='assets_project_sha')],
            },
        ),
        migrations.CreateModel(
            name='Font',
            fields=[
                ('id', snapfile.core.fields.UUIDv7Field(default=snapfile.core.ids.uuid7, editable=False, primary_key=True, serialize=False)),
                ('family', models.CharField(max_length=128)),
                ('weight', models.PositiveSmallIntegerField()),
                ('style', models.CharField(default='normal', max_length=8)),
                ('postscript_name', models.CharField(max_length=128)),
                ('format', models.CharField(max_length=8)),
                ('converted', models.BooleanField(default=False)),
                ('sha256', models.CharField(max_length=64)),
                ('size_bytes', models.PositiveIntegerField()),
                ('path', models.CharField(max_length=512)),
                ('web_path', models.CharField(max_length=512)),
                ('metrics_path', models.CharField(max_length=512)),
                ('pdf_font_path', models.CharField(max_length=512)),
                ('units_per_em', models.PositiveSmallIntegerField()),
                ('ascender', models.IntegerField()),
                ('descender', models.IntegerField()),
                ('line_gap', models.IntegerField()),
                ('cap_height', models.IntegerField()),
                ('x_height', models.IntegerField()),
                ('glyph_count', models.PositiveIntegerField()),
                ('unicode_ranges', models.JSONField(default=dict)),
                ('license_note', models.TextField(blank=True, null=True)),
                ('embeddable', models.BooleanField(default=True)),
                ('created_by', models.JSONField(blank=True, null=True)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
                ('project', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='fonts', to='projects.project')),
            ],
            options={
                'db_table': 'fonts',
                'constraints': [models.UniqueConstraint(fields=('project', 'sha256'), name='fonts_project_sha'), models.UniqueConstraint(fields=('project', 'family', 'weight', 'style'), name='fonts_project_face')],
            },
        ),
    ]
