# Generated by Django 5.0.2 on 2024-04-04 19:24

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


class Migration(migrations.Migration):

    dependencies = [
        ('atlas', '0045_casecollection_authors_only'),
    ]

    operations = [
        migrations.CreateModel(
            name='Resource',
            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, null=True)),
                ('url', models.URLField(blank=True, null=True)),
                ('file', models.FileField(blank=True, null=True, upload_to='atlas/resources/')),
            ],
        ),
        migrations.CreateModel(
            name='CaseResource',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('case', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='atlas.case')),
                ('resource', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='atlas.resource')),
            ],
        ),
        migrations.AddField(
            model_name='case',
            name='resource',
            field=models.ManyToManyField(through='atlas.CaseResource', to='atlas.resource'),
        ),
    ]
