# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-09-10 16:17
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('is_visible', models.BooleanField(default=True)),
                ('name', models.CharField(max_length=64)),
                ('color', models.CharField(max_length=7)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('is_visible', models.BooleanField(default=True)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='profile', to=settings.AUTH_USER_MODEL, verbose_name='User')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Purchase',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('is_visible', models.BooleanField(default=True)),
                ('title', models.CharField(max_length=128)),
                ('description', models.CharField(max_length=256)),
                ('price_currency', djmoney.models.fields.CurrencyField(choices=[('BRL', 'Brazilian Real')], default='BRL', editable=False, max_length=3)),
                ('price', djmoney.models.fields.MoneyField(decimal_places=2, default=None, default_currency='BRL', editable=False, max_digits=8, null=True, verbose_name='Price')),
                ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='purchases_created', to='core.Profile')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Risk',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('is_visible', models.BooleanField(default=True)),
                ('title', models.CharField(max_length=128)),
                ('description', models.CharField(max_length=256)),
                ('probability', models.IntegerField(choices=[(0, 'Impossible'), (20, 'A bit likely'), (40, 'Likely'), (60, 'Very likely'), (80, 'Almost certain')], default=0)),
                ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='risks_created', to='core.Profile')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Task',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('is_visible', models.BooleanField(default=True)),
                ('title', models.CharField(max_length=128)),
                ('description', models.CharField(max_length=256)),
                ('starting_at', models.DateTimeField()),
                ('ending_at', models.DateTimeField()),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tasks', to='core.Category')),
                ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tasks_created', to='core.Profile')),
                ('members', models.ManyToManyField(related_name='tasks', to='core.Profile')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='risk',
            name='tasks',
            field=models.ManyToManyField(related_name='risks', to='core.Task'),
        ),
        migrations.AddField(
            model_name='purchase',
            name='tasks',
            field=models.ManyToManyField(related_name='purchases', to='core.Task'),
        ),
        migrations.AddField(
            model_name='category',
            name='created_by',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='categories_created', to='core.Profile'),
        ),
    ]
