0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-25 11:17:50 +01:00
posthog/ee/migrations/0002_hook.py
Michael Matloka 5d2ad6c7bb
chore(deps): Update black to 22.8.0 (#11596)
* chore(deps): Update `black` to `22.8.0`

* Format
2022-09-05 14:38:54 +02:00

56 lines
1.8 KiB
Python

# Generated by Django 3.0.6 on 2020-08-18 12:10
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
import posthog.models.utils
class Migration(migrations.Migration):
dependencies = [
("posthog", "0082_personalapikey"),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("ee", "0001_initial"),
]
operations = [
migrations.CreateModel(
name="Hook",
fields=[
("created", models.DateTimeField(auto_now_add=True)),
("updated", models.DateTimeField(auto_now=True)),
("event", models.CharField(db_index=True, max_length=64, verbose_name="Event")),
("target", models.URLField(max_length=255, verbose_name="Target URL")),
(
"id",
models.CharField(
default=posthog.models.utils.generate_random_token,
max_length=50,
primary_key=True,
serialize=False,
),
),
("resource_id", models.IntegerField(blank=True, null=True)),
(
"team",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, related_name="rest_hooks", to="posthog.Team"
),
),
(
"user",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="rest_hooks",
to=settings.AUTH_USER_MODEL,
),
),
],
options={
"abstract": False,
},
),
]