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(taxonomy): Add project field to taxonomy models #26521

Merged
merged 12 commits into from
Dec 6, 2024

Conversation

Twixes
Copy link
Member

@Twixes Twixes commented Nov 28, 2024

Problem

Step 9 of the environments implementation plan. (Same as #25600, just for taxonomy models.)

Changes

Added nullable field project to the EventDefinition, PropertyDefinition, and EventProperty models. We now insert it in ingestion.

Backfill for existing event definitions, property definitions, and event properties will come in a separate PR.

How did you test this code?

All existing tests should continue to pass.

Copy link
Member Author

Choose a reason for hiding this comment

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

Only types need to be updated in the plugin server, since these records are SELECTed with *

@Twixes Twixes requested a review from oliverb123 November 29, 2024 16:29
@Twixes Twixes marked this pull request as ready for review November 29, 2024 16:29
@Twixes Twixes requested review from a team and removed request for oliverb123 December 3, 2024 21:36
Copy link
Contributor

@oliverb123 oliverb123 left a comment

Choose a reason for hiding this comment

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

Looks fine except for the integer type thing, but approving so once you fix you can merge

@@ -84,6 +84,7 @@ impl GroupType {
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Ord)]
pub struct PropertyDefinition {
pub team_id: i32,
pub project_id: i32,
Copy link
Contributor

Choose a reason for hiding this comment

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

bigint's are i64's, I think? 8 bytes wide.

@@ -9,6 +9,7 @@ CREATE TABLE IF NOT EXISTS posthog_eventdefinition (
volume_30_day INTEGER,
query_usage_30_day INTEGER,
team_id INTEGER NOT NULL,
project_id INTEGER NULL,
Copy link
Contributor

Choose a reason for hiding this comment

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

Better to keep these in sync and make them a bigint

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, now i64!

@Twixes Twixes merged commit caaf6a0 into master Dec 6, 2024
89 checks passed
@Twixes Twixes deleted the taxonomy-project branch December 6, 2024 09:49
pauldambra added a commit that referenced this pull request Dec 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