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

C-2161 - Optimize handling of segments activity channels #1384

Merged

Conversation

loicsaintroch
Copy link
Member

@loicsaintroch loicsaintroch commented Aug 28, 2023

Changes proposed ✍️

What

🤖 Generated by Copilot at 9a47210

This pull request introduces a new table segmentActivityChannels to store the activity channels data for the segments, which are groups of users who share common characteristics or behaviors. It also updates the SegmentRepository and the settings.repo classes to use the new table instead of the activityChannels column in the segments table. Additionally, it provides the migration scripts to create and drop the new table and to transfer the existing data.

🤖 Generated by Copilot at 9a47210

To store segment activity channels
We used to update JSONB panels
But now we have made
A new table and trade
The complex column for simpler annals

Why

How

🤖 Generated by Copilot at 9a47210

  • Create segmentActivityChannels table to store the relation between segments and their activity channels (link)
  • Drop segmentActivityChannels table in undo migration script (link)
  • Insert existing activity channels data from segments table into segmentActivityChannels table using JSONB query (link)
  • Remove activityChannels column from segments table update logic in segmentRepository.ts (link, link)
  • Insert or ignore activity channels data into segmentActivityChannels table in segmentRepository.ts update method using ON CONFLICT DO NOTHING query (link)
  • Join segmentActivityChannels table and select platform and channel columns in segmentRepository.ts getSubprojects method (link)
  • Process subprojects data and populate activityChannels property of each segment with platform-channel object in segmentRepository.ts getSubprojects method (link)
  • Insert or update activity channels data into segmentActivityChannels table in settings.repo.ts updateSegmentActivityChannels method using ON CONFLICT DO NOTHING query (link)
  • Remove activityChannels column update logic from settings.repo.ts updateSegmentActivityChannels method (link)

Checklist ✅

  • Label appropriately with Feature, Improvement, or Bug.
  • Add screehshots to the PR description for relevant FE changes
  • New backend functionality has been unit-tested.
  • API documentation has been updated (if necessary) (see docs on API documentation).
  • Quality standards are met.

@loicsaintroch loicsaintroch added the Improvement Created by Linear-GitHub Sync label Aug 28, 2023
@loicsaintroch loicsaintroch self-assigned this Aug 28, 2023
@loicsaintroch loicsaintroch marked this pull request as draft August 28, 2023 09:49
@loicsaintroch loicsaintroch marked this pull request as ready for review August 29, 2023 14:54
@themarolt themarolt merged commit 5527aea into main Sep 4, 2023
8 checks passed
@themarolt themarolt deleted the feature/c-2161-optimize-handling-of-segmentsactivitychannels branch September 4, 2023 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Created by Linear-GitHub Sync
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants