# -*- coding: utf-8 -*-
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

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

    operations = [
        migrations.CreateModel(
            name='Habit',
            fields=[
                ('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', primary_key=True)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=255)),
                ('description', models.CharField(max_length=255)),
                ('generated_by', models.CharField(max_length=10, choices=[('admin', 'admin'), ('user', 'user')])),
            ],
            options={
                'abstract': False,
            },
            bases=(models.Model,),
        ),
        migrations.CreateModel(
            name='Schedule',
            fields=[
                ('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', primary_key=True)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('event_time', models.TimeField(verbose_name='time', null=True)),
                ('repeat', models.CharField(max_length=9, choices=[('every_day', 'every day'), ('every_mon', 'every monday'), ('every_tue', 'every tuesday'), ('every_wed', 'every wednesday'), ('every_thu', 'every thursday'), ('every_fri', 'every friday'), ('every_sat', 'every saturday'), ('every_sun', 'every sunday')], default='every_day')),
            ],
            options={
                'abstract': False,
            },
            bases=(models.Model,),
        ),
        migrations.CreateModel(
            name='UserHabit',
            fields=[
                ('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', primary_key=True)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('habit', models.ForeignKey(to='habits.Habit', related_name='user_habit_set')),
                ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, related_name='user_habit_set')),
            ],
            options={
                'abstract': False,
            },
            bases=(models.Model,),
        ),
        migrations.AddField(
            model_name='schedule',
            name='user_habit',
            field=models.ForeignKey(to='habits.UserHabit'),
            preserve_default=True,
        ),
        migrations.AddField(
            model_name='habit',
            name='users',
            field=models.ManyToManyField(to=settings.AUTH_USER_MODEL, through='habits.UserHabit'),
            preserve_default=True,
        ),
    ]
