Skip to content

Add trial column to subscription_add_on_purchases table

What does this MR do and why?

In issue https://gitlab.com/gitlab-org/gitlab/-/issues/448506+, we discussed and agreed that: adding a trial field to GitlabSubscriptions::AddOnPurchase table is useful to clearly tells whether a pack is from trial order, or from the paid subscription.

This MR adds trial column to subscription_add_on_purchases table

This column tells whether the AddOn pack is from trial order or from paid subscription. Default to false.

Changelog: added EE: true

Database

Output from db:migrate
% bundle exec rake db:migrate:main
main: == [advisory_lock_connection] object_id: 120060, pg_backend_pid: 54111
main: == 20240320062459 AddTrialToSubscriptionAddOnPurchases: migrating =============
main: -- add_column(:subscription_add_on_purchases, :trial, :boolean, {:default=>false, :null=>false})
main:    -> 0.0017s
main: == 20240320062459 AddTrialToSubscriptionAddOnPurchases: migrated (0.0048s) ====

main: == [advisory_lock_connection] object_id: 120060, pg_backend_pid: 54111
Output from db:rollback
% bundle exec rake db:migrate:down:main VERSION=20240320062459
main: == [advisory_lock_connection] object_id: 119780, pg_backend_pid: 54437
main: == 20240320062459 AddTrialToSubscriptionAddOnPurchases: reverting =============
main: -- remove_column(:subscription_add_on_purchases, :trial, :boolean, {:default=>false, :null=>false})
main:    -> 0.0012s
main: == 20240320062459 AddTrialToSubscriptionAddOnPurchases: reverted (0.0055s) ====

main: == [advisory_lock_connection] object_id: 119780, pg_backend_pid: 54437

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

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Edited by Qingyu Zhao

Merge request reports