# Generated by Django 4.2.26 on 2025-11-29 14:32

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


class Migration(migrations.Migration):

    dependencies = [
        ('crm', '0006_student_wechat_nickname'),
    ]

    operations = [
        migrations.AddField(
            model_name='project',
            name='project_type',
            field=models.CharField(choices=[('training', '小主持语言培训'), ('competition', '赛事管理'), ('grading', '考级管理')], default='training', max_length=20, verbose_name='项目类型'),
        ),
        migrations.CreateModel(
            name='StudentProject',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.CharField(choices=[('enrolled', '已报名'), ('completed', '已完成'), ('cancelled', '已取消')], default='enrolled', max_length=20, verbose_name='状态')),
                ('enrolled_at', models.DateTimeField(auto_now_add=True, verbose_name='报名时间')),
                ('completed_at', models.DateTimeField(blank=True, null=True, verbose_name='完成时间')),
                ('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='enrollments', to='crm.project', verbose_name='项目')),
                ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='enrollments', to='crm.student', verbose_name='学员')),
            ],
            options={
                'verbose_name': '学员项目报名',
                'verbose_name_plural': '学员项目报名',
                'ordering': ['-enrolled_at'],
                'unique_together': {('student', 'project')},
            },
        ),
    ]
