Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(environments): Backfill project ID on group types #25980

Merged
merged 7 commits into from
Nov 6, 2024

Conversation

Twixes
Copy link
Member

@Twixes Twixes commented Nov 4, 2024

Problem

Continued step 6 of the environments implementation plan.
#25600 added the GroupTypeMapping.project field, but existing group types still have a null value there.

Changes

This sets project on every posthog_grouptypemapping record, and then makes the field non-nullable in two stages.
Stage 1 – this PR: NOT NULL constraint is created with NOT VALID so that the table is not locked.
Stage 2 – follow-up PR #25876: We VALIDATE the constraint to enforce it in a non-locking way.

The two stages must be in separate migrations to actually avoid locking.

@Twixes Twixes requested review from aspicer and a team and removed request for aspicer November 5, 2024 12:44
@Twixes Twixes force-pushed the group-type-project-backfill branch from 13aced8 to c4e80d3 Compare November 5, 2024 14:27
@Twixes Twixes force-pushed the group-type-project-backfill branch from c4e80d3 to dcdad27 Compare November 5, 2024 14:57
@Twixes Twixes merged commit 8a356a5 into master Nov 6, 2024
89 checks passed
@Twixes Twixes deleted the group-type-project-backfill branch November 6, 2024 08:31
benjackwhite added a commit that referenced this pull request Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants