# Generated by Django 5.2.7 on 2025-11-17 05:52

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='UploadedFile',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('path', models.FileField(help_text='文件存储路径，包含前缀、随机文件名和后缀', max_length=500, upload_to='uploads/%Y/%m/%d/', verbose_name='文件路径')),
                ('is_deleted', models.BooleanField(default=False, help_text='软删除标记', verbose_name='是否已删除')),
                ('original_filename', models.CharField(blank=True, help_text='用户上传时的原始文件名', max_length=255, verbose_name='原始文件名')),
                ('file_size', models.BigIntegerField(blank=True, null=True, verbose_name='文件大小(字节)')),
                ('content_type', models.CharField(blank=True, help_text='MIME类型，如 image/jpeg', max_length=100, verbose_name='文件类型')),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='uploaded_files', to=settings.AUTH_USER_MODEL, verbose_name='上传者')),
            ],
            options={
                'verbose_name': '上传文件',
                'verbose_name_plural': '上传文件',
                'db_table': 'api_uploaded_file',
                'ordering': ['-created_at'],
            },
        ),
    ]
