# Generated by Django 3.0.3 on 2020-08-05 10:29

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Article',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=150)),
                ('start_date', models.DateField(blank=True, null=True)),
                ('end_date', models.DateField(blank=True, null=True)),
                ('keywords', models.CharField(blank=True, max_length=300, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='ArticleEvaluation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('state', models.CharField(max_length=150)),
            ],
        ),
        migrations.CreateModel(
            name='ArticleInReview',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('round', models.IntegerField(blank=True, default=1, null=True)),
                ('description', models.FileField(blank=True, null=True, upload_to='')),
                ('start_date', models.DateField(null=True)),
                ('final_date', models.DateField(blank=True, null=True)),
                ('article', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='revista_cientifica.Article')),
            ],
        ),
        migrations.CreateModel(
            name='Author',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('institution', models.CharField(blank=True, max_length=200, null=True)),
                ('ORCID', models.IntegerField(null=True, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Evaluation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('evaluation', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='MCC',
            fields=[
                ('id', models.CharField(max_length=20, primary_key=True, serialize=False)),
                ('area', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='State',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('state', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Referee',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('articles', models.ManyToManyField(through='revista_cientifica.ArticleInReview', to='revista_cientifica.Article')),
                ('speciality', models.ManyToManyField(to='revista_cientifica.MCC')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Participation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_email_author', models.BooleanField(default=False)),
                ('article', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='revista_cientifica.Article')),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='revista_cientifica.Author')),
            ],
            options={
                'unique_together': {('author', 'article')},
            },
        ),
        migrations.CreateModel(
            name='Notification',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content', models.CharField(max_length=500)),
                ('ref', models.CharField(max_length=300)),
                ('date', models.DateTimeField(blank=True, default=django.utils.timezone.now)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='File',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('file', models.FileField(upload_to='media/')),
                ('file_name', models.CharField(max_length=150)),
                ('date', models.DateTimeField(blank=True, default=django.utils.timezone.now, null=True)),
                ('article', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='revista_cientifica.Article')),
            ],
        ),
        migrations.AddField(
            model_name='author',
            name='articles',
            field=models.ManyToManyField(through='revista_cientifica.Participation', to='revista_cientifica.Article'),
        ),
        migrations.AddField(
            model_name='author',
            name='user',
            field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='articleinreview',
            name='evaluation',
            field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='revista_cientifica.Evaluation'),
        ),
        migrations.AddField(
            model_name='articleinreview',
            name='referee',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='revista_cientifica.Referee'),
        ),
        migrations.AddField(
            model_name='articleinreview',
            name='state',
            field=models.ForeignKey(default=3, on_delete=django.db.models.deletion.CASCADE, to='revista_cientifica.State'),
        ),
        migrations.AddField(
            model_name='article',
            name='evaluation',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='revista_cientifica.ArticleEvaluation'),
        ),
        migrations.AddField(
            model_name='article',
            name='mcc',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='revista_cientifica.MCC'),
        ),
    ]
