# Generated by Django 5.1.4 on 2024-12-17 16:50

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


class Migration(migrations.Migration):
    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="DataSource",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=150, unique=True)),
                (
                    "dotted_path",
                    models.CharField(
                        help_text="E.g. apps.accounting.data_sources.Invoice",
                        max_length=255,
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="Report",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("active", models.BooleanField(default=True)),
                (
                    "_engine",
                    models.CharField(
                        choices=[
                            ("stimulsoft", "Stimulsoft"),
                            ("fastreport", "FastReport"),
                        ],
                        max_length=50,
                        verbose_name="Engine",
                    ),
                ),
                ("name", models.CharField(max_length=255, unique=True)),
                ("file", models.FileField(upload_to="reports/")),
                ("cache_required", models.BooleanField(default=True)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                (
                    "data_source",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="reports",
                        to="djreport.datasource",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
    ]
