# Generated by Django 3.2.20 on 2023-09-05 11:01

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


class Migration(migrations.Migration):
    dependencies = [
        ("database", "0126_alter_rowhistory_options"),
    ]

    operations = [
        migrations.CreateModel(
            name="ViewGroupBy",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "order",
                    models.CharField(
                        choices=[("ASC", "Ascending"), ("DESC", "Descending")],
                        default="ASC",
                        help_text="Indicates the sort order direction. ASC (Ascending) is from A to Z and DESC (Descending) is from Z to A.",
                        max_length=4,
                    ),
                ),
                (
                    "field",
                    models.ForeignKey(
                        help_text="The field that must be grouped by.",
                        on_delete=django.db.models.deletion.CASCADE,
                        to="database.field",
                    ),
                ),
                (
                    "view",
                    models.ForeignKey(
                        help_text="The view to which the group by applies. Each view can have his own group bys.",
                        on_delete=django.db.models.deletion.CASCADE,
                        to="database.view",
                    ),
                ),
            ],
            options={
                "ordering": ("id",),
            },
        ),
    ]
