Skip to content

Add previous_weight to resource_weight_events

What does this MR do and why?

Add previous_weight to resource_weight_events to allow us to show what the weight was change from and to (at the moment we can only see what it was changed to).

Related to #409673 (closed)

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 migrations

bundle exec rake db:migrate:up:main VERSION=20240107084243 RAILS_ENV=development

main: == [advisory_lock_connection] object_id: 182180, pg_backend_pid: 48303
main: == 20240107084243 AddPreviousWeightToResourceWeightEvents: migrating ==========
main: -- add_column(:resource_weight_events, :previous_weight, :integer)
main:    -> 0.0067s
main: == 20240107084243 AddPreviousWeightToResourceWeightEvents: migrated (0.0106s) =

bundle exec rake db:migrate:down:main VERSION=20240107084243 RAILS_ENV=development

main: == [advisory_lock_connection] object_id: 182220, pg_backend_pid: 51905
main: == 20240107084243 AddPreviousWeightToResourceWeightEvents: reverting ==========
main: -- remove_column(:resource_weight_events, :previous_weight, :integer)
main:    -> 0.0033s
main: == 20240107084243 AddPreviousWeightToResourceWeightEvents: reverted (0.0092s) =

How to set up and validate locally

n/a

Edited by Lee Tickett

Merge request reports