# Generated by Django 2.1.3 on 2018-11-06 15:53

from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Author',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('scholar_id', models.IntegerField(null=True, unique=True)),
                ('email', models.CharField(max_length=255, unique=True)),
                ('first_name', models.CharField(max_length=255)),
                ('last_name', models.CharField(max_length=255)),
                ('submitter', models.BooleanField(default=False)),
                ('first_author', models.BooleanField(default=False)),
                ('volunteer', models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name='Authorship',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('number', models.IntegerField()),
                ('author', models.ForeignKey(on_delete='cascade', to='bidding.Author')),
            ],
        ),
        migrations.CreateModel(
            name='Bid',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('score', models.IntegerField()),
                ('weight', models.FloatField(null=True)),
                ('author', models.ForeignKey(on_delete='cascade', to='bidding.Author')),
            ],
        ),
        migrations.CreateModel(
            name='Paper',
            fields=[
                ('id', models.IntegerField(primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=255)),
                ('abstract', models.TextField()),
            ],
        ),
        migrations.AddField(
            model_name='bid',
            name='paper',
            field=models.ForeignKey(on_delete='cascade', to='bidding.Paper'),
        ),
        migrations.AddField(
            model_name='authorship',
            name='paper',
            field=models.ForeignKey(on_delete='cascade', to='bidding.Paper'),
        ),
        migrations.AddField(
            model_name='author',
            name='bids',
            field=models.ManyToManyField(related_name='bids', through='bidding.Bid', to='bidding.Paper'),
        ),
        migrations.AddField(
            model_name='author',
            name='papers',
            field=models.ManyToManyField(related_name='authors', through='bidding.Authorship', to='bidding.Paper'),
        ),
        migrations.AlterUniqueTogether(
            name='bid',
            unique_together={('author', 'paper')},
        ),
    ]
