# Generated by Django 2.2.3 on 2019-08-14 12:15

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


class Migration(migrations.Migration):

    dependencies = [
        ('core', '0003_remove_upload_completed'),
    ]

    operations = [
        migrations.CreateModel(
            name='ReservedResourceRecord',
            fields=[
                ('_id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('_created', models.DateTimeField(auto_now_add=True)),
                ('_last_updated', models.DateTimeField(auto_now=True, null=True)),
                ('resource', models.CharField(max_length=255, unique=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='TaskReservedResourceRecord',
            fields=[
                ('_id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('_created', models.DateTimeField(auto_now_add=True)),
                ('_last_updated', models.DateTimeField(auto_now=True, null=True)),
                ('resource', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.ReservedResourceRecord')),
                ('task', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Task')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='reservedresourcerecord',
            name='tasks',
            field=models.ManyToManyField(related_name='reserved_resources_record', through='core.TaskReservedResourceRecord', to='core.Task'),
        ),
    ]
