# Generated by Django 4.2.4 on 2023-09-15 11:20

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("django_napse_core", "0001_initial"),
    ]

    operations = [
        migrations.CreateModel(
            name="NapseAPIKey",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=200)),
                ("description", models.TextField()),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("napse_API_key", models.CharField(max_length=200, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name="KeyPermission",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("valid", models.BooleanField(default=True)),
                ("permission_type", models.CharField(max_length=200)),
                (
                    "key",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="permissions",
                        to="django_napse_auth.napseapikey",
                    ),
                ),
                (
                    "space",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="django_napse_core.napsespace",
                    ),
                ),
            ],
        ),
    ]
