Skip to content

Commit

Permalink
fix(data-models): Update migration to defer constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasfarias committed Aug 7, 2024
1 parent 1634d90 commit b367634
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions posthog/migrations/0452_datawarehousemodelpath_and_more.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Generated by Django 4.2.14 on 2024-08-06 18:20
# Generated by Django 4.2.14 on 2024-08-07 13:24

import django.contrib.postgres.indexes
import django.db.models.deletion
from django.conf import settings
import django.contrib.postgres.indexes
from django.db import migrations, models

import django.db.models.constraints
import django.db.models.deletion
import posthog.models.utils
import posthog.warehouse.models.modeling

Expand All @@ -15,7 +15,6 @@ class Migration(migrations.Migration):
]

operations = [
migrations.RunSQL("CREATE EXTENSION ltree;"),
migrations.CreateModel(
name="DataWarehouseModelPath",
fields=[
Expand Down Expand Up @@ -66,6 +65,10 @@ class Migration(migrations.Migration):
),
migrations.AddConstraint(
model_name="datawarehousemodelpath",
constraint=models.UniqueConstraint(fields=("team_id", "path"), name="unique_team_id_path"),
constraint=models.UniqueConstraint(
deferrable=django.db.models.constraints.Deferrable["IMMEDIATE"],
fields=("team_id", "path"),
name="unique_team_id_path",
),
),
]

0 comments on commit b367634

Please sign in to comment.