# Generated by Django 3.0.3 on 2020-02-20 09:45

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


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('project_core', '0104_delete_colour'),
    ]

    operations = [
        migrations.CreateModel(
            name='HistoricalProposal',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('created_on', models.DateTimeField(blank=True, editable=False, help_text='Date and time at which the entry was created')),
                ('modified_on', models.DateTimeField(blank=True, editable=False, help_text='Date and time at which the entry was modified', null=True)),
                ('uuid', models.UUIDField(db_index=True, default=uuid.uuid4, editable=False)),
                ('title', models.CharField(help_text='Title of the proposal being submitted', max_length=500)),
                ('location', models.CharField(blank=True, help_text='Name of more precise location of where proposal would take place (not coordinates)', max_length=200, null=True)),
                ('start_date', models.DateField(help_text='Approximate date on which the proposed project is expected to start')),
                ('end_date', models.DateField(help_text='Approximate date on which the proposed project is expected to end')),
                ('duration_months', models.DecimalField(decimal_places=1, help_text='Expected duration of the proposed project in months', max_digits=5, validators=[django.core.validators.MinValueValidator(0)])),
                ('eligibility', models.CharField(choices=[('Eligibility not checked', 'Eligibility not checked'), ('Eligible', 'Eligible'), ('Not eligible', 'Not eligible')], default='Eligibility not checked', help_text='Status of eligibility of proposal', max_length=30)),
                ('eligibility_comment', models.TextField(blank=True, help_text='Comments regarding eligibility of proposal', null=True)),
                ('draft_saved_mail_sent', models.BooleanField(default=False, help_text='True if the email informing the applicant that the draft has been saved has already been sent (usually is sent only once)')),
                ('submitted_mail_sent', models.BooleanField(default=False, help_text='True if the email informing the applicant that the proposal has been submitted has been sent')),
                ('history_id', models.AutoField(primary_key=True, serialize=False)),
                ('history_date', models.DateTimeField()),
                ('history_change_reason', models.CharField(max_length=100, null=True)),
                ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
                ('applicant', models.ForeignKey(blank=True, db_constraint=False, help_text='Main applicant of the proposal', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='project_core.PersonPosition')),
                ('call', models.ForeignKey(blank=True, db_constraint=False, help_text='Call to which the proposal relates', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='project_core.Call')),
                ('created_by', models.ForeignKey(blank=True, db_constraint=False, help_text='User by which the entry was created', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)),
                ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
                ('modified_by', models.ForeignKey(blank=True, db_constraint=False, help_text='User by which the entry was modified', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)),
                ('overarching_project', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='project_core.ExternalProject')),
                ('proposal_status', models.ForeignKey(blank=True, db_constraint=False, help_text='Status or outcome of the proposal', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='project_core.ProposalStatus')),
            ],
            options={
                'verbose_name': 'historical proposal',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
