# Generated by Django 3.2.13 on 2023-01-03 13:33

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


class Migration(migrations.Migration):

    dependencies = [
        ('ddm', '0021_auto_20221222_0925'),
    ]

    operations = [
        migrations.CreateModel(
            name='FileUploader',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=250)),
                ('index', models.PositiveIntegerField()),
                ('upload_type', models.CharField(choices=[('zip_file', 'Zip File'), ('single_file', 'Single File')], default='single_file', max_length=20, verbose_name='Upload type')),
            ],
        ),
        migrations.RemoveField(
            model_name='blueprintcontainer',
            name='project',
        ),
        migrations.RemoveConstraint(
            model_name='donationinstruction',
            name='unique_index_per_blueprint',
        ),
        migrations.RemoveConstraint(
            model_name='donationinstruction',
            name='unique_index_per_container',
        ),
        migrations.RemoveField(
            model_name='donationblueprint',
            name='blueprint_container',
        ),
        migrations.RemoveField(
            model_name='donationblueprint',
            name='index',
        ),
        migrations.RemoveField(
            model_name='donationinstruction',
            name='blueprint',
        ),
        migrations.RemoveField(
            model_name='donationinstruction',
            name='blueprint_container',
        ),
        migrations.DeleteModel(
            name='BlueprintContainer',
        ),
        migrations.AddField(
            model_name='fileuploader',
            name='project',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ddm.donationproject'),
        ),
        migrations.AddField(
            model_name='donationblueprint',
            name='file_uploader',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='ddm.fileuploader', verbose_name='Associated File Uploader'),
        ),
        migrations.AddField(
            model_name='donationinstruction',
            name='file_uploader',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='ddm.fileuploader', verbose_name='Associated File Uploader'),
        ),
        migrations.AddConstraint(
            model_name='donationinstruction',
            constraint=models.UniqueConstraint(fields=('index', 'file_uploader'), name='unique_index_per_file_uploader'),
        ),
    ]
