# Generated by Django 3.0 on 2019-12-15 02:01

import core.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid


class Migration(migrations.Migration):

    dependencies = [
        ('core', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Artifact',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('type', models.CharField(choices=[(core.models.ArtifactType['ORTHOMOSAIC'], 'Orthomosaic'), (core.models.ArtifactType['SHAPEFILE'], 'Shapefile')], max_length=20)),
            ],
        ),
        migrations.CreateModel(
            name='Flight',
            fields=[
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=50)),
                ('date', models.DateField(auto_now_add=True)),
                ('camera', models.CharField(choices=[(core.models.Camera['REDEDGE'], 'Micasense RedEdge'), (core.models.Camera['RGB'], 'RGB')], max_length=10)),
                ('multispectral_processing', models.BooleanField(default=False)),
                ('annotations', models.TextField()),
                ('deleted', models.BooleanField(default=False)),
                ('state', models.CharField(choices=[(core.models.FlightState['WAITING'], 'Waiting for images'), (core.models.FlightState['PROCESSING'], 'Processing'), (core.models.FlightState['COMPLETE'], 'Complete'), (core.models.FlightState['PAUSED'], 'Paused'), (core.models.FlightState['CANCELED'], 'Canceled')], max_length=10)),
            ],
        ),
        migrations.RemoveField(
            model_name='user',
            name='bio',
        ),
        migrations.RemoveField(
            model_name='user',
            name='birth_date',
        ),
        migrations.RemoveField(
            model_name='user',
            name='location',
        ),
        migrations.AddField(
            model_name='user',
            name='organization',
            field=models.CharField(blank=True, max_length=20),
        ),
        migrations.AddField(
            model_name='user',
            name='type',
            field=models.CharField(choices=[(core.models.UserType['DEMO_USER'], 'DemoUser'), (core.models.UserType['ACTIVE'], 'Active'), (core.models.UserType['DELETED'], 'Deleted'), (core.models.UserType['ADMIN'], 'Admin')], default=core.models.UserType['DEMO_USER'], max_length=20),
        ),
        migrations.CreateModel(
            name='UserProject',
            fields=[
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=50)),
                ('description', models.TextField()),
                ('deleted', models.BooleanField(default=False)),
                ('artifacts', models.ManyToManyField(related_name='user_projects', to='core.Artifact')),
                ('flights', models.ManyToManyField(related_name='user_projects', to='core.Flight')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user_projects', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='flight',
            name='user',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.CreateModel(
            name='DemoProject',
            fields=[
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=50)),
                ('description', models.TextField()),
                ('deleted', models.BooleanField(default=False)),
                ('artifacts', models.ManyToManyField(related_name='demo_projects', to='core.Artifact')),
                ('flights', models.ManyToManyField(related_name='demo_projects', to='core.Flight')),
                ('users', models.ManyToManyField(related_name='demo_projects', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='artifact',
            name='flight',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='artifacts', to='core.Flight'),
        ),
    ]
