"""
Phase 8 — Budget.

Generated by `makemigrations` and left as generated: one new table, nothing
existing touched.

Two columns are worth reading off it. **`amount_minor` is a `BigIntegerField`,
not a `DecimalField`** — DRF serialises a decimal as a string, and one
`Number()` on the way in puts the whole ledger back on floating point.
**`category` is a `CharField`, not a foreign key** — categories are a
page-scoped vocabulary inside `Page.settings`, which the server never
interprets. Both are argued in `models/budget.py`.
"""

# Generated by Django 6.0.6 on 2026-09-18 12:20

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


class Migration(migrations.Migration):

    dependencies = [
        ('lifey_api', '0006_habits'),
    ]

    operations = [
        migrations.CreateModel(
            name='Transaction',
            fields=[
                ('id', models.BigAutoField(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)),
                ('kind', models.CharField(default='expense', max_length=8)),
                ('name', models.CharField(blank=True, max_length=300)),
                ('date', models.DateField()),
                ('amount_minor', models.BigIntegerField(default=0)),
                ('category', models.CharField(blank=True, max_length=64, null=True)),
                ('notes', models.TextField(blank=True)),
                ('properties', models.JSONField(blank=True, default=dict)),
                ('is_sample', models.BooleanField(default=False)),
                ('page', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='transactions', to='lifey_api.page')),
            ],
            options={
                'ordering': ['date', 'id'],
                'indexes': [models.Index(fields=['page', 'date'], name='lifey_api_t_page_id_8dcd73_idx'), models.Index(fields=['page', 'category'], name='lifey_api_t_page_id_a6778f_idx')],
            },
        ),
    ]
