# Generated by Django 3.1.7 on 2021-03-13 04:32

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


class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="Dashboard",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("slug", models.SlugField(unique=True)),
                ("title", models.CharField(blank=True, max_length=128)),
                ("description", models.TextField(blank=True)),
            ],
            options={
                "permissions": [("execute_sql", "Can execute arbitrary SQL queries")],
            },
        ),
        migrations.CreateModel(
            name="DashboardQuery",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("sql", models.TextField()),
                (
                    "dashboard",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="queries",
                        to="django_sql_dashboard.dashboard",
                    ),
                ),
            ],
            options={
                "verbose_name_plural": "Dashboard queries",
                "order_with_respect_to": "dashboard",
            },
        ),
    ]
