Skip to content

Update type of subscription_add_on_purchases started_at column

What does this MR do and why?

Updates the started_at column in the subscription_add_on_purchases table. That column was originally created with precision to match the created_at column that was used before the started_at column was created, however the data being sent from the customers portal application only provides date level precision. So the column should be updated to mach the granularity of the data it will actually hold.

This column is new in 17.1 and the code to populate it has not yet been merged.

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
$ RAILS_ENV=development bin/rails db:migrate
main: == [advisory_lock_connection] object_id: 125280, pg_backend_pid: 89882
main: == 20240521190729 UpdateSubscriptionAddOnPurchasesStartedAtPrecision: migrating
main: -- change_column(:subscription_add_on_purchases, :started_at, :date)
main:    -> 0.0049s
main: == 20240521190729 UpdateSubscriptionAddOnPurchasesStartedAtPrecision: migrated (0.0093s)

main: == [advisory_lock_connection] object_id: 125280, pg_backend_pid: 89882
Output from db:rollback
$ RAILS_ENV=development bin/rails db:migrate:down:main VERSION=20240521190729
main: == [advisory_lock_connection] object_id: 124960, pg_backend_pid: 90321
main: == 20240521190729 UpdateSubscriptionAddOnPurchasesStartedAtPrecision: reverting
main: -- change_column(:subscription_add_on_purchases, :started_at, :datetime_with_timezone)
main:    -> 0.0038s
main: == 20240521190729 UpdateSubscriptionAddOnPurchasesStartedAtPrecision: reverted (0.0073s)

main: == [advisory_lock_connection] object_id: 124960, pg_backend_pid: 90321
Edited by Isabel Sandin

Merge request reports