Add relation between Namespace and GitlabSubscriptions::SubscriptionHistory
What does this MR do and why?
This is the second of a series of MRs to implement https://gitlab.com/gitlab-org/gitlab/-/issues/355985 as part of https://gitlab.com/groups/gitlab-org/-/epics/14290
Proof of Concept (to see the whole picture): !159045 (closed)
In this MR we:
- Add relation between Namespace and GitlabSubscriptions::SubscriptionHistory
- As per feedback here !159901 (comment 2006806175) added index by
namespace_id
- As per feedback here !159901 (comment 2006806175) added index by
- To test this we created a factory for
GitlabSubscriptions::SubscriptionHistory
MR Cadence
MR | description |
---|---|
!159901 (merged) | Move GitlabSubscriptionHistory to GitlabSubscriptions::SubscriptionHistory |
!159921 (merged) |
|
!159933 (closed) | Add subscription_history to Namespace GraphQL Type |
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
N/A
How to set up and validate locally
Execute something like this in rails console
:
Group.find(<namespace_id>).gitlab_subscription_histories
Where namespace_id
is the id of a Group with a paid subscription.
SQL
SELECT "gitlab_subscription_histories".* FROM "gitlab_subscription_histories" WHERE "gitlab_subscription_histories"."namespace_id" = 113
- Explain in postgres.ai: https://explain.depesz.com/s/UywaG
- Explain locally: https://explain.depesz.com/s/f97l
Edited by Sheldon Led