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: normalize data in PG across tables #9932

Open
1 task
mattkrick opened this issue Jul 3, 2024 · 2 comments · May be fixed by #11026 or #10992
Open
1 task

chore: normalize data in PG across tables #9932

mattkrick opened this issue Jul 3, 2024 · 2 comments · May be fixed by #11026 or #10992
Assignees
Labels

Comments

@mattkrick
Copy link
Member

mattkrick commented Jul 3, 2024

We've gotten into a pretty bad habit of denormalizing data across tables. This makes updates tricky because you have to update the field in multiple tables!

Here are some culprits I've found that we should remove. As we find more we should add them here & try really hard to have a single source of truth!

  • Organization.tier (truth)
  • User.tier
  • OrganizationUser.tier
  • Organization.trialStartDate (truth)
  • OrganizationUser.trialStartDate
  • Team.trialStartDate
  • User.trialStartDate (🫤 denormalized across 4 tables total?!)
  • User.picture (truth)
  • TeamMember.picture
  • User.preferredName (truth)
  • TeamMember.preferredName
  • User.inactive (truth)
  • Organization.inactive
  • Organization.isPaid (truth)
  • Team.isPaid
  • User.tms (TeamMember is truth)

AC

  • refactor setUserTierForUserIds, setUserTierForOrgId, setTierForOrgUsers
@tianrunhe
Copy link
Contributor

Related issue on MAU discrepancy between weekly stat and core metrics

Copy link
Contributor

github-actions bot commented Mar 4, 2025

Stale issue

@github-actions github-actions bot added the stale label Mar 4, 2025
@Dschoordsch Dschoordsch self-assigned this Mar 10, 2025
@Dschoordsch Dschoordsch moved this from Ready to In progress in Product Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: In progress
Development

Successfully merging a pull request may close this issue.

3 participants