<reponame>rheinwerk-verlag/planning-poker
# Generated by Django 3.0.3 on 2021-04-27 06:36

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='PokerSession',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('poker_date', models.DateField(verbose_name='Poker Date')),
                ('name', models.CharField(max_length=200, verbose_name='Name')),
            ],
            options={
                'verbose_name': 'Poker Session',
                'verbose_name_plural': 'Poker Sessions',
                'ordering': ['-poker_date'],
            },
        ),
        migrations.CreateModel(
            name='Story',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ticket_number', models.CharField(max_length=200, verbose_name='Ticket Number')),
                ('title', models.CharField(blank=True, max_length=200, verbose_name='Title')),
                ('description', models.TextField(blank=True, verbose_name='Description')),
                ('story_points', models.PositiveSmallIntegerField(blank=True, choices=[(None, '-'), (1, '1'), (2, '2'), (3, '3'), (5, '5'), (8, '8'), (13, '13'), (21, '21'), (34, '34')], help_text='The amount of points this story takes up in the sprint', null=True, verbose_name='Story Points')),
                ('poker_session', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='stories', to='planning_poker.PokerSession', verbose_name='Poker Session')),
            ],
            options={
                'verbose_name': 'Story',
                'verbose_name_plural': 'Stories',
                'permissions': [('vote', 'Can vote for a story.'), ('moderate', 'Is able to moderate a planning_poker session.')],
            },
        ),
        migrations.CreateModel(
            name='Vote',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('choice', models.CharField(choices=[('1', '1'), ('2', '2'), ('3', '3'), ('5', '5'), ('8', '8'), ('13', '13'), ('21', '21'), ('34', '34'), ('Too large', 'Too large'), ('No idea', 'No idea')], max_length=200, verbose_name='Choice')),
                ('story', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='votes', to='planning_poker.Story', verbose_name='Story')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='votes', to=settings.AUTH_USER_MODEL, verbose_name='User')),
            ],
            options={
                'verbose_name': 'Vote',
                'verbose_name_plural': 'Votes',
            },
        ),
        migrations.AddField(
            model_name='pokersession',
            name='active_story',
            field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='active_in', to='planning_poker.Story', verbose_name='Active Story'),
        ),
        migrations.AddConstraint(
            model_name='vote',
            constraint=models.UniqueConstraint(fields=('story', 'user'), name='A user can only vote once for each story.'),
        ),
        migrations.AlterOrderWithRespectTo(
            name='story',
            order_with_respect_to='poker_session',
        ),
    ]

# Generated by Django 3.0.3 on 2021-04-27 06:36

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='PokerSession',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('poker_date', models.DateField(verbose_name='Poker Date')),
                ('name', models.CharField(max_length=200, verbose_name='Name')),
            ],
            options={
                'verbose_name': 'Poker Session',
                'verbose_name_plural': 'Poker Sessions',
                'ordering': ['-poker_date'],
            },
        ),
        migrations.CreateModel(
            name='Story',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ticket_number', models.CharField(max_length=200, verbose_name='Ticket Number')),
                ('title', models.CharField(blank=True, max_length=200, verbose_name='Title')),
                ('description', models.TextField(blank=True, verbose_name='Description')),
                ('story_points', models.PositiveSmallIntegerField(blank=True, choices=[(None, '-'), (1, '1'), (2, '2'), (3, '3'), (5, '5'), (8, '8'), (13, '13'), (21, '21'), (34, '34')], help_text='The amount of points this story takes up in the sprint', null=True, verbose_name='Story Points')),
                ('poker_session', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='stories', to='planning_poker.PokerSession', verbose_name='Poker Session')),
            ],
            options={
                'verbose_name': 'Story',
                'verbose_name_plural': 'Stories',
                'permissions': [('vote', 'Can vote for a story.'), ('moderate', 'Is able to moderate a planning_poker session.')],
            },
        ),
        migrations.CreateModel(
            name='Vote',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('choice', models.CharField(choices=[('1', '1'), ('2', '2'), ('3', '3'), ('5', '5'), ('8', '8'), ('13', '13'), ('21', '21'), ('34', '34'), ('Too large', 'Too large'), ('No idea', 'No idea')], max_length=200, verbose_name='Choice')),
                ('story', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='votes', to='planning_poker.Story', verbose_name='Story')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='votes', to=settings.AUTH_USER_MODEL, verbose_name='User')),
            ],
            options={
                'verbose_name': 'Vote',
                'verbose_name_plural': 'Votes',
            },
        ),
        migrations.AddField(
            model_name='pokersession',
            name='active_story',
            field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='active_in', to='planning_poker.Story', verbose_name='Active Story'),
        ),
        migrations.AddConstraint(
            model_name='vote',
            constraint=models.UniqueConstraint(fields=('story', 'user'), name='A user can only vote once for each story.'),
        ),
        migrations.AlterOrderWithRespectTo(
            name='story',
            order_with_respect_to='poker_session',
        ),
    ]
# Generated by Django 3.0.3 on 2021-04-27 06:36