# Generated by Django 5.1.3 on 2025-01-17 08:55

import django.db.models.deletion
import django.utils.timezone
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Calculation',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_on', models.DateTimeField(auto_now=True, verbose_name='Created on')),
            ],
            options={
                'ordering': ['-created_on'],
            },
        ),
        migrations.CreateModel(
            name='Expense',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('amount', models.DecimalField(decimal_places=2, max_digits=6, verbose_name='Amount')),
                ('paid_on', models.DateTimeField(blank=True, default=django.utils.timezone.now, verbose_name='Paid on')),
                ('info', models.TextField(blank=True, verbose_name='Info')),
                ('calculation', models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='expenses', to='together.calculation', verbose_name='Calculation')),
                ('paid_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='paid_by_expenses', to=settings.AUTH_USER_MODEL, verbose_name='Paid by')),
                ('paid_for', models.ManyToManyField(related_name='paid_for_expenses', to=settings.AUTH_USER_MODEL, verbose_name='Paid for')),
            ],
            options={
                'ordering': ['-paid_on', 'paid_by'],
            },
        ),
    ]
