Skip to content

Create migration to add started_at to subscription_add_on_purchases

What does this MR do and why?

The recent change to extend Duo Pro trials uncovered that we don't store the start date of Duo Pro trials. When trials were guaranteed to be exactly 30 the start date could be calculated from the end date, however that no longer holds true. This MR adds a started_at column to subscription_add_on_purchases to store that data going forward, in preparation for a companion MR to the Customers-Gitlab-com application to begin sending that data when the trial is synced to GitLab.com.

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.

Database

Output from db:migrate
$ bundle exec rake db:migrate:main

main: == [advisory_lock_connection] object_id: 125080, pg_backend_pid: 28245
main: == 20240513200811 AddStartedOnToSubscriptionAddOnPurchases: migrating =========
main: -- add_column(:subscription_add_on_purchases, :started_on, :datetime_with_timezone)
main:    -> 0.0013s
main: == 20240513200811 AddStartedOnToSubscriptionAddOnPurchases: migrated (0.0046s)

main: == [advisory_lock_connection] object_id: 125080, pg_backend_pid: 28245
Output from db:rollback
$ bundle exec rake db:migrate:down:main VERSION=20240513200811
main: == [advisory_lock_connection] object_id: 124800, pg_backend_pid: 30112
main: == 20240513200811 AddStartedOnToSubscriptionAddOnPurchases: reverting =========
main: -- remove_column(:subscription_add_on_purchases, :started_on, :datetime_with_timezone)
main:    -> 0.0014s
main: == 20240513200811 AddStartedOnToSubscriptionAddOnPurchases: reverted (0.0055s)

main: == [advisory_lock_connection] object_id: 124800, pg_backend_pid: 30112
Edited by Isabel Sandin

Merge request reports