# Generated by Django 3.0 on 2019-12-21 07:58

import datetime
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='BotAdmin',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('uid', models.CharField(max_length=20, verbose_name='User unique ID')),
                ('name', models.CharField(max_length=75, verbose_name='Name')),
            ],
        ),
        migrations.CreateModel(
            name='Channel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=30, verbose_name='Channel name')),
                ('uid', models.CharField(max_length=20, verbose_name='Channel unique ID')),
                ('web_hook', models.URLField(blank=True, verbose_name='Incoming webhook')),
                ('stand_up_time', models.TimeField(default=datetime.time(11, 0), verbose_name='Stand up time')),
            ],
        ),
        migrations.CreateModel(
            name='Member',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('uid', models.CharField(max_length=20, unique=True, verbose_name='User unique ID')),
                ('telegram_handler', models.CharField(blank=True, max_length=100, null=True)),
                ('name', models.CharField(max_length=75, verbose_name='Name')),
                ('channels', models.ManyToManyField(blank=True, related_name='members', to='slack.Channel', verbose_name='Linked channels')),
            ],
            options={
                'verbose_name_plural': 'Members',
            },
        ),
        migrations.CreateModel(
            name='Standup',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('time', models.DateTimeField(auto_now_add=True, verbose_name='Standup submitted time')),
                ('text', models.TextField(verbose_name='Standup content')),
                ('channel', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='standups', to='slack.Channel', verbose_name='Linked channel')),
                ('member', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='standups', to='slack.Member', verbose_name='Standup author')),
            ],
        ),
        migrations.CreateModel(
            name='Miss',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateField(verbose_name='Missed day')),
                ('channel', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='misses', to='slack.Channel', verbose_name='Linked channel')),
                ('member', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='misses', to='slack.Member', verbose_name='mentee')),
            ],
            options={
                'verbose_name_plural': 'Misses',
                'ordering': ('-date', 'channel'),
                'unique_together': {('member', 'channel', 'date')},
            },
        ),
        migrations.CreateModel(
            name='Excuse',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('reason', models.CharField(max_length=255)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('until', models.DateField()),
                ('channel', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='excuses', to='slack.Channel', verbose_name='Linked channel')),
                ('member', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='excuses', to='slack.Member', verbose_name='mentee')),
            ],
            options={
                'verbose_name_plural': 'Excuses',
                'ordering': ('-until', 'channel'),
                'unique_together': {('member', 'channel', 'until')},
            },
        ),
    ]
