0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-22 08:40:03 +01:00
posthog/ee/migrations/0004_enterpriseeventdefinition_enterprisepropertydefinition.py
Li Yi Yu 7546e3ea0a
Event properties taxonomy (#4486)
* add description and tag fields to event and property definitions

* set up description and tagging on models

* frontend functionality for description editing

* connect backend and kea logic for description editing

* update event and property definitions model and migration

* delete set null instead of cascade

* migration merge fix

* add owner column

* undo posthog event property taxonomy migrations

* set up definitions on enterprise level

* allow enterprise definitions description editing

* fix licensing conditions and add tests

* proper get and update methods for the multi inheritance table and new column fields for enterprise event model

* check for license to separate routes

* migrate existing definitions to ee definitions tables and render ee vs non-ee definition views based on existing feature conditional

* all the working backend updates

* updated tests

* frontend fixes and linting updates

* feature flag it
2021-06-03 09:22:16 -04:00

92 lines
3.4 KiB
Python

# Generated by Django 3.1.8 on 2021-06-02 19:42
import django.contrib.postgres.fields
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("posthog", "0156_insight_short_id"),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("ee", "0003_license_max_users"),
]
operations = [
migrations.CreateModel(
name="EnterprisePropertyDefinition",
fields=[
(
"propertydefinition_ptr",
models.OneToOneField(
auto_created=True,
on_delete=django.db.models.deletion.CASCADE,
parent_link=True,
primary_key=True,
serialize=False,
to="posthog.propertydefinition",
),
),
("description", models.CharField(blank=True, max_length=400)),
(
"tags",
django.contrib.postgres.fields.ArrayField(
base_field=models.CharField(max_length=32), blank=True, default=list, null=True, size=None
),
),
("updated_at", models.DateTimeField(auto_now=True)),
(
"updated_by",
models.ForeignKey(
blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL
),
),
],
options={"abstract": False,},
bases=("posthog.propertydefinition",),
),
migrations.CreateModel(
name="EnterpriseEventDefinition",
fields=[
(
"eventdefinition_ptr",
models.OneToOneField(
auto_created=True,
on_delete=django.db.models.deletion.CASCADE,
parent_link=True,
primary_key=True,
serialize=False,
to="posthog.eventdefinition",
),
),
("description", models.CharField(blank=True, max_length=400)),
(
"tags",
django.contrib.postgres.fields.ArrayField(
base_field=models.CharField(max_length=32), blank=True, default=list, null=True, size=None
),
),
("updated_at", models.DateTimeField(auto_now=True)),
(
"owner",
models.ForeignKey(
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="event_definitions",
to=settings.AUTH_USER_MODEL,
),
),
(
"updated_by",
models.ForeignKey(
blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL
),
),
],
options={"abstract": False,},
bases=("posthog.eventdefinition",),
),
]