# Generated by Django 5.1.5 on 2026-01-07 11:29

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


class Migration(migrations.Migration):

    dependencies = [
        ('sheets', '0010_excelentry_constant_300_excelentry_druckkorrektur_and_more'),
    ]

    operations = [
        migrations.AlterField(
            model_name='betriebskosten',
            name='kostentyp',
            field=models.CharField(choices=[('sach', 'Sachkosten'), ('ln2', 'LN2'), ('helium', 'Helium'), ('inv', 'Inventar')], max_length=10, verbose_name='Kostentyp'),
        ),
        migrations.CreateModel(
            name='MonthlySheet',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('year', models.IntegerField()),
                ('month', models.IntegerField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'ordering': ['year', 'month'],
                'unique_together': {('year', 'month')},
            },
        ),
        migrations.CreateModel(
            name='Cell',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('table_type', models.CharField(choices=[('top_left', 'Top Left Table'), ('top_right', 'Top Right Table'), ('bottom_1', 'Bottom Table 1'), ('bottom_2', 'Bottom Table 2'), ('bottom_3', 'Bottom Table 3')], max_length=20)),
                ('row_index', models.IntegerField()),
                ('column_index', models.IntegerField()),
                ('value', models.DecimalField(blank=True, decimal_places=6, max_digits=15, null=True)),
                ('formula', models.TextField(blank=True)),
                ('is_formula', models.BooleanField(default=False)),
                ('data_type', models.CharField(choices=[('number', 'Number'), ('text', 'Text'), ('date', 'Date')], default='number', max_length=20)),
                ('client', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='sheets.client')),
                ('sheet', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cells', to='sheets.monthlysheet')),
            ],
        ),
        migrations.CreateModel(
            name='CellReference',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('source_cell', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='dependents', to='sheets.cell')),
                ('target_cell', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='dependencies', to='sheets.cell')),
            ],
            options={
                'unique_together': {('source_cell', 'target_cell')},
            },
        ),
        migrations.AddIndex(
            model_name='cell',
            index=models.Index(fields=['sheet', 'table_type', 'row_index'], name='sheets_cell_sheet_i_511238_idx'),
        ),
        migrations.AlterUniqueTogether(
            name='cell',
            unique_together={('sheet', 'client', 'table_type', 'row_index', 'column_index')},
        ),
    ]
