# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2018-04-03 12:07
from __future__ import unicode_literals

import datetime
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='CSchedules',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=100, verbose_name='Заголовок расписания')),
                ('timezone', models.CharField(choices=[('ru', 'Россия'), ('cis', 'СНГ'), ('others', 'Страны мира')], max_length=3, verbose_name='Часовой пояс')),
                ('timezone_place', models.CharField(max_length=100, verbose_name='Местоположение')),
                ('use_work_weekend', models.BooleanField(default=True, verbose_name='Учитывать рабочие выходные')),
                ('use_holiday', models.BooleanField(default=False, verbose_name='Учитывать праздничные дни')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('owner', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='c_shedules_list', to=settings.AUTH_USER_MODEL, verbose_name='Создатель')),
            ],
            options={
                'verbose_name': 'Планировщик расписания',
                'verbose_name_plural': 'Список планировщиков расписаний',
                'ordering': ['-created_at'],
            },
        ),
        migrations.CreateModel(
            name='CSchedulesDays',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('day_number', models.IntegerField(validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(7)], verbose_name='Номер дня')),
                ('start_time', models.TimeField(validators=[django.core.validators.MinValueValidator(datetime.time(0, 0), django.core.validators.MaxValueValidator(datetime.time(23, 59)))], verbose_name='Старт')),
                ('end_time', models.TimeField(verbose_name='Конец')),
                ('c_schedules', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='days', to='c_schedules.CSchedules', verbose_name='Планировщик')),
            ],
            options={
                'verbose_name': 'День в расписании',
                'verbose_name_plural': 'Список дней в расписании',
                'ordering': ['day_number'],
            },
        ),
        migrations.AlterUniqueTogether(
            name='cschedulesdays',
            unique_together=set([('c_schedules', 'day_number', 'start_time', 'end_time')]),
        ),
    ]
