# Generated by Django 6.0.1 on 2026-04-30 14:55

import django.db.models.deletion
import django_extensions.db.fields
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('submission', '0010_remove_conversation_fk'),
    ]

    operations = [
        migrations.CreateModel(
            name='Award',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
                ('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
                ('name', models.CharField(max_length=100, unique=True, verbose_name='奖项名称')),
                ('description', models.TextField(blank=True, default='', verbose_name='奖项简介')),
                ('sort_order', models.IntegerField(db_index=True, default=0, verbose_name='排序值')),
                ('is_active', models.BooleanField(default=True, verbose_name='是否启用')),
                ('item_ordering', models.CharField(choices=[('manual', '手动排序'), ('awarded_at', '授奖时间倒序'), ('score', '评分倒序'), ('view_count', '浏览量倒序')], default='manual', max_length=20, verbose_name='作品排序方式')),
            ],
            options={
                'ordering': ('sort_order',),
            },
        ),
        migrations.CreateModel(
            name='SubmissionAward',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
                ('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
                ('sort_order', models.IntegerField(db_index=True, default=0, verbose_name='手动排序值')),
                ('awarded_at', models.DateTimeField(auto_now_add=True, db_index=True, verbose_name='授奖时间')),
                ('award', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='submission_awards', to='submission.award')),
                ('submission', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='awards', to='submission.submission')),
            ],
            options={
                'ordering': ('sort_order',),
                'unique_together': {('submission', 'award')},
            },
        ),
    ]
