# Generated by Django 5.2.8 on 2025-12-14 00:42

import django.db.models.deletion
import smoothschedule.scheduling.schedule.models
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('schedule', '0037_add_location_model'),
    ]

    operations = [
        migrations.CreateModel(
            name='Album',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('description', models.TextField(blank=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'ordering': ['-created_at'],
            },
        ),
        migrations.CreateModel(
            name='MediaFile',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('file', models.ImageField(help_text='The uploaded image file', upload_to=smoothschedule.scheduling.schedule.models.MediaFile.upload_to)),
                ('filename', models.CharField(help_text='Original filename', max_length=255)),
                ('alt_text', models.CharField(blank=True, help_text='Alt text for accessibility', max_length=255)),
                ('file_size', models.PositiveIntegerField(help_text='File size in bytes')),
                ('width', models.PositiveIntegerField(blank=True, help_text='Image width in pixels', null=True)),
                ('height', models.PositiveIntegerField(blank=True, help_text='Image height in pixels', null=True)),
                ('mime_type', models.CharField(help_text='MIME type (e.g., image/jpeg)', max_length=100)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('album', models.ForeignKey(blank=True, help_text='Album this file belongs to', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='files', to='schedule.album')),
            ],
            options={
                'ordering': ['-created_at'],
            },
        ),
        migrations.AddField(
            model_name='album',
            name='cover_image',
            field=models.ForeignKey(blank=True, help_text='Cover image for this album', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='cover_for_albums', to='schedule.mediafile'),
        ),
        migrations.AddIndex(
            model_name='mediafile',
            index=models.Index(fields=['album', '-created_at'], name='schedule_me_album_i_0e8d85_idx'),
        ),
        migrations.AddIndex(
            model_name='mediafile',
            index=models.Index(fields=['mime_type'], name='schedule_me_mime_ty_05ad5b_idx'),
        ),
    ]
