# Generated by Django 4.2.23 on 2025-08-31 13:52

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


class Migration(migrations.Migration):

    dependencies = [
        ('rattingtax', '0002_corpmonthstat_closed'),
    ]

    operations = [
        migrations.CreateModel(
            name='CorpJournalEntry',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('division', models.PositiveSmallIntegerField()),
                ('journal_id', models.BigIntegerField(blank=True, null=True)),
                ('date', models.DateTimeField(db_index=True)),
                ('ref_type', models.CharField(db_index=True, max_length=64)),
                ('amount', models.DecimalField(decimal_places=2, max_digits=20)),
                ('context_id', models.BigIntegerField(blank=True, null=True)),
                ('reason', models.TextField(blank=True)),
                ('corp', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='journal_entries', to='rattingtax.corporation')),
            ],
            options={
                'default_permissions': (),
                'indexes': [models.Index(fields=['corp', 'date'], name='rattingtax__corp_id_5ebf8e_idx'), models.Index(fields=['corp', 'ref_type'], name='rattingtax__corp_id_110f2d_idx')],
                'unique_together': {('corp', 'division', 'journal_id')},
            },
        ),
    ]
