Skip to content

Draft: Removes Members.last_activity_on default value

Vijay Hawoldar requested to merge vij-remove-member-default-value into master

What does this MR do and why?

Initially when adding the last_activity_on column to the Members table, we added a default value so that it was auto-populated until we had implemented the tracking that actually populates the value.

In #461338 (closed) we implemented tracking for Member activity, so we no longer need (or want) the default value.

This MR removes the default.

Refs #462751 (closed)

Database details

migrate up

bin/rails db:migrate                                 

main: == [advisory_lock_connection] object_id: 128580, pg_backend_pid: 90819
main: == 20240701094837 RemoveMembersLastActivityOnDefaultValue: migrating ==========
main: -- change_column_default(:members, :last_activity_on, {:to=>nil})
main:    -> 0.0157s
main: == 20240701094837 RemoveMembersLastActivityOnDefaultValue: migrated (0.0196s) =

migrate down

bin/rails db:migrate:down:main VERSION=20240701094837
main: == [advisory_lock_connection] object_id: 128100, pg_backend_pid: 91278
main: == 20240701094837 RemoveMembersLastActivityOnDefaultValue: reverting ==========
main: -- change_column_default(:members, :last_activity_on, #<Proc:0x000000030ee7a5c0 /code/gdk/gitlab/db/post_migrate/20240701094837_remove_members_last_activity_on_default_value.rb:14 (lambda)>)
main:    -> 0.0415s
main: == 20240701094837 RemoveMembersLastActivityOnDefaultValue: reverted (0.0459s) =

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 Vijay Hawoldar

Merge request reports

Loading