Skip to content

Commit

Permalink
chore(Persons): Remove foreign key constraints for all persons models
Browse files Browse the repository at this point in the history
  • Loading branch information
timgl committed Jan 17, 2025
1 parent 88497af commit 8bd7e4e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Generated by Django 4.2.15 on 2025-01-17 01:29

from django.db import migrations
from django.db.migrations.operations.special import SeparateDatabaseAndState


class Migration(migrations.Migration):
dependencies = [
("posthog", "0545_insight_filters_to_query"),
]

operations = [
SeparateDatabaseAndState(
database_operations=[
migrations.RunSQL(
"""
ALTER TABLE posthog_person DROP CONSTRAINT IF EXISTS posthog_person_team_id_fkey;
ALTER TABLE posthog_person DROP CONSTRAINT IF EXISTS posthog_person_is_user_id_fkey;
ALTER TABLE posthog_persondistinctid DROP CONSTRAINT IF EXISTS posthog_persondistinctid_team_id_fkey;
ALTER TABLE posthog_personlessdistinctid DROP CONSTRAINT IF EXISTS posthog_personlessdistinctid_team_id_fkey;
ALTER TABLE posthog_featureflaghashkeyoverride DROP CONSTRAINT IF EXISTS posthog_featureflaghashkeyoverride_team_id_fkey;
ALTER TABLE posthog_cohortpeople DROP CONSTRAINT IF EXISTS posthog_cohortpeople_cohort_id_fkey;
""",
"""
-- No reverse SQL needed since we're dropping constraints that will be recreated in a different form
""",
)
],
state_operations=[],
),
]
2 changes: 1 addition & 1 deletion posthog/migrations/max_migration.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0545_insight_filters_to_query
0546_remove_featureflaghashkeyoverride_unique_hash_key_for_a_user_team_feature_flag_combo_and_more

0 comments on commit 8bd7e4e

Please sign in to comment.