# Generated by Django 2.2.6 on 2019-11-02 06:35

from django.conf import settings
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='Conta',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('descricao_conta', models.CharField(max_length=50)),
                ('saldo', models.FloatField(default=0)),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='Usuario', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Tipo_conta',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('tipo_conta', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Tipo_despesa',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('tipo_despesa', models.CharField(max_length=30)),
            ],
            options={
                'verbose_name': 'tipo_despesa',
            },
        ),
        migrations.CreateModel(
            name='Tipo_receita',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('tipo_receita', models.CharField(max_length=30)),
            ],
            options={
                'verbose_name': 'tipo_receita',
            },
        ),
        migrations.CreateModel(
            name='Usuario',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('cpf', models.CharField(max_length=14)),
                ('email', models.EmailField(max_length=254)),
                ('usuario', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='usuario', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Receita',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('valor', models.FloatField()),
                ('descricao', models.TextField()),
                ('data', models.DateTimeField(auto_now_add=True)),
                ('conta', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='financeiro.Conta')),
                ('tipo_receita', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='financeiro.Tipo_receita')),
                ('usuario', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='financeiro.Usuario')),
            ],
            options={
                'verbose_name': 'Receita',
                'verbose_name_plural': 'Receitas',
            },
        ),
        migrations.CreateModel(
            name='Despesa',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('valor', models.FloatField()),
                ('descricao', models.TextField()),
                ('data', models.DateTimeField(auto_now_add=True)),
                ('conta', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='financeiro.Conta')),
                ('tipo_despesa', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='financeiro.Tipo_despesa')),
                ('usuario', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='financeiro.Usuario')),
            ],
            options={
                'verbose_name': 'Despesa',
                'verbose_name_plural': 'Despesas',
            },
        ),
        migrations.AddField(
            model_name='conta',
            name='tipo_conta',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='financeiro.Tipo_conta'),
        ),
    ]
