Skip to content

Add relation between Namespace and GitlabSubscriptions::SubscriptionHistory

Sheldon Led requested to merge led/351280-gitlab-subscription-history-api-2 into master

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:

  1. Add relation between Namespace and GitlabSubscriptions::SubscriptionHistory
    1. As per feedback here !159901 (comment 2006806175) added index by namespace_id
  2. To test this we created a factory for GitlabSubscriptions::SubscriptionHistory

MR Cadence

MR description
!159901 (merged) Move GitlabSubscriptionHistory to GitlabSubscriptions::SubscriptionHistory
!159921 (merged) 👈 you're here
!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:

  1. 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
Edited by Sheldon Led

Merge request reports

Loading