# Generated by Django 3.2.5 on 2021-07-10 08:54

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


class Migration(migrations.Migration):

    dependencies = [
        ('budget', '0002_budget_owner'),
    ]

    operations = [
        migrations.CreateModel(
            name='BudgetGroup',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='date created')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='date updated')),
                ('name', models.CharField(max_length=255, verbose_name='Group name')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='BudgetToGroupRelation',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='date created')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='date updated')),
                ('budget', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='budget.budget')),
                ('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='budget.budgetgroup')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='budgetgroup',
            name='budgets',
            field=models.ManyToManyField(through='budget.BudgetToGroupRelation', to='budget.Budget'),
        ),
        migrations.AddField(
            model_name='budget',
            name='groups',
            field=models.ManyToManyField(through='budget.BudgetToGroupRelation', to='budget.BudgetGroup'),
        ),
    ]
