# Generated by Django 3.2.4 on 2021-07-03 11:32

import uuid

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


class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="WebHook",
            fields=[
                (
                    "name",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("num_hits", models.IntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name="WebHookData",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "received_at",
                    models.DateTimeField(default=django.utils.timezone.now),
                ),
                ("payload", models.TextField(default=None, null=True)),
                ("query_params", models.TextField(default=None, null=True)),
                ("headers", models.TextField(default=None, null=True)),
                ("webhook_hit_number", models.IntegerField(default=0)),
                (
                    "webhook",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE, to="core.webhook"
                    ),
                ),
            ],
        ),
        migrations.AddIndex(
            model_name="webhookdata",
            index=models.Index(
                fields=["received_at"], name="core_webhoo_receive_672f94_idx"
            ),
        ),
    ]
