<reponame>aphp/Cohort360-Back-end
# Generated by Django 2.2.9 on 2020-12-01 15:17

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='GitlabIssue',
            fields=[
                ('uuid', models.UUIDField(auto_created=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('modified_at', models.DateTimeField(auto_now=True)),
                ('iid', models.IntegerField(unique=True)),
                ('state', models.CharField(choices=[('opened', 'Opened'), ('closed', 'Closed')], max_length=6)),
                ('labels', models.TextField()),
                ('gitlab_created_at', models.DateTimeField()),
                ('gitlab_updated_at', models.DateTimeField(null=True)),
                ('gitlab_closed_at', models.DateTimeField(null=True)),
                ('title', models.TextField()),
                ('description', models.TextField(blank=True)),
                ('votes_positive_sum', models.IntegerField(default=0)),
                ('votes_neutral_sum', models.IntegerField(default=0)),
                ('votes_negative_sum', models.IntegerField(default=0)),
                ('votes_total_sum', models.IntegerField(default=0)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Vote',
            fields=[
                ('uuid', models.UUIDField(auto_created=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('modified_at', models.DateTimeField(auto_now=True)),
                ('vote', models.IntegerField(choices=[(1, 'Positive vote'), (0, 'Neutral vote'), (-1, 'Negative vote')], default=0)),
                ('issue', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='vote_issues', to='voting.GitlabIssue')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='vote_users', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddConstraint(
            model_name='vote',
            constraint=models.UniqueConstraint(fields=('issue', 'user'), name='unique_together_issue_user'),
        ),
    ]

# Generated by Django 2.2.9 on 2020-12-01 15:17

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='GitlabIssue',
            fields=[
                ('uuid', models.UUIDField(auto_created=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('modified_at', models.DateTimeField(auto_now=True)),
                ('iid', models.IntegerField(unique=True)),
                ('state', models.CharField(choices=[('opened', 'Opened'), ('closed', 'Closed')], max_length=6)),
                ('labels', models.TextField()),
                ('gitlab_created_at', models.DateTimeField()),
                ('gitlab_updated_at', models.DateTimeField(null=True)),
                ('gitlab_closed_at', models.DateTimeField(null=True)),
                ('title', models.TextField()),
                ('description', models.TextField(blank=True)),
                ('votes_positive_sum', models.IntegerField(default=0)),
                ('votes_neutral_sum', models.IntegerField(default=0)),
                ('votes_negative_sum', models.IntegerField(default=0)),
                ('votes_total_sum', models.IntegerField(default=0)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Vote',
            fields=[
                ('uuid', models.UUIDField(auto_created=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('modified_at', models.DateTimeField(auto_now=True)),
                ('vote', models.IntegerField(choices=[(1, 'Positive vote'), (0, 'Neutral vote'), (-1, 'Negative vote')], default=0)),
                ('issue', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='vote_issues', to='voting.GitlabIssue')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='vote_users', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddConstraint(
            model_name='vote',
            constraint=models.UniqueConstraint(fields=('issue', 'user'), name='unique_together_issue_user'),
        ),
    ]
# Generated by Django 2.2.9 on 2020-12-01 15:17