# Generated by Django 2.2.1 on 2019-06-11 16:32

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


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('core', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Employee',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('role', models.IntegerField(choices=[(1, 'Administrator'), (2, 'Szef'), (3, 'Kierownik zespolu'), (4, 'Pracownik')], default=4)),
                ('team_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='belongs', to='core.Team')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Employee_KR',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('employee_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='employee_execute', to='core.Employee')),
            ],
        ),
        migrations.CreateModel(
            name='Employee_OKR',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('employee_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='employee_owns', to='core.Employee')),
            ],
        ),
        migrations.CreateModel(
            name='KR',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=60)),
                ('goal', models.IntegerField(default=0)),
                ('progress', models.IntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='OKR',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=60)),
                ('start_date', models.DateField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='Team_KR',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('kr', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='core.KR')),
                ('team_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='team_execute', to='core.Team')),
            ],
        ),
        migrations.CreateModel(
            name='Team_OKR',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('okr', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='core.OKR')),
                ('team_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='team_owns', to='core.Team')),
            ],
        ),
        migrations.DeleteModel(
            name='UserProfile',
        ),
        migrations.AddField(
            model_name='kr',
            name='okr_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='contains', to='core.OKR'),
        ),
        migrations.AddField(
            model_name='employee_okr',
            name='okr',
            field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='core.OKR'),
        ),
        migrations.AddField(
            model_name='employee_kr',
            name='kr',
            field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='core.KR'),
        ),
    ]
