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

refactor(insights): add migration to convert filters to query #24527

Merged
merged 9 commits into from
Jan 16, 2025

Conversation

thmsobrmlr
Copy link
Contributor

@thmsobrmlr thmsobrmlr commented Aug 22, 2024

Problem

We're currently migrating insight filters to query in Django shell. Unfortunately self-hosted users are left out.

Changes

Does the same for self hosted users.

⚠️ This should only be merged after we completed the migration with Django shell. ⚠️

How did you test this code?

DEBUG=1 python manage.py migrate
DEBUG=1 python manage.py migrate posthog 0458_alter_insightviewed_team_alter_insightviewed_user
SELECT COUNT(filters->>'migrated_at') * 1.0 / COUNT(*) FROM posthog_dashboarditem

@thmsobrmlr thmsobrmlr requested a review from a team August 22, 2024 13:47
Copy link
Contributor

@skoob13 skoob13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks great! It only needs to update the migration number;

posthog/migrations/0459_insight_filters_to_query.py Outdated Show resolved Hide resolved
posthog/migrations/0459_insight_filters_to_query.py Outdated Show resolved Hide resolved
@thmsobrmlr thmsobrmlr added waiting Prevents stale-bot from marking the PR as stale. and removed stale labels Sep 2, 2024
@Twixes Twixes self-requested a review September 6, 2024 15:33
@thmsobrmlr thmsobrmlr enabled auto-merge (squash) January 16, 2025 11:57
@thmsobrmlr thmsobrmlr disabled auto-merge January 16, 2025 13:54
@PostHog PostHog deleted a comment from posthog-bot Jan 16, 2025
@thmsobrmlr thmsobrmlr force-pushed the filters_to_query_migration branch from 814f070 to 4ccc678 Compare January 16, 2025 13:55
# Conflicts:
#	posthog/migrations/max_migration.txt
@thmsobrmlr thmsobrmlr enabled auto-merge (squash) January 16, 2025 13:57
@thmsobrmlr thmsobrmlr merged commit 642cc55 into master Jan 16, 2025
92 checks passed
@thmsobrmlr thmsobrmlr deleted the filters_to_query_migration branch January 16, 2025 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting Prevents stale-bot from marking the PR as stale.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants