Skip to content

Drop user details fields from users table

Brian Austin requested to merge (removed):206913-drop-user-detail-fields into master

What does this MR do and why?

As of !102351 (merged)

  • linkedin
  • twitter
  • skype
  • website_url
  • location
  • organization

are delegated to the user_details table. Before removing the ignore_columns in the User model for those fields, the actual columns need to be dropped.

rake db:migrate

main: == 20230116160904 RemoveUserDetailsFieldsFromUser: migrating ==================
main: -- remove_column(:users, :linkedin, :character, {:null=>false, :default=>""})
main:    -> 0.0031s
main: -- remove_column(:users, :twitter, :character, {:null=>false, :default=>""})
main:    -> 0.0012s
main: -- remove_column(:users, :skype, :text, {:null=>false, :default=>""})
main:    -> 0.0010s
main: -- remove_column(:users, :website_url, :text, {:null=>false, :default=>""})
main:    -> 0.0011s
main: -- remove_column(:users, :location, :text, {:null=>false, :default=>""})
main:    -> 0.0092s
main: -- remove_column(:users, :organization, :text, {:null=>false, :default=>""})
main:    -> 0.0024s
main: == 20230116160904 RemoveUserDetailsFieldsFromUser: migrated (0.0273s) =========

rake db:rollback

DOWN::
main: == 20230116160904 RemoveUserDetailsFieldsFromUser: reverting ==================
main: -- add_column(:users, :organization, :text, {:null=>false, :default=>""})
main:    -> 0.0044s
main: -- add_column(:users, :location, :text, {:null=>false, :default=>""})
main:    -> 0.0025s
main: -- add_column(:users, :website_url, :text, {:null=>false, :default=>""})
main:    -> 0.0023s
main: -- add_column(:users, :skype, :text, {:null=>false, :default=>""})
main:    -> 0.0027s
main: -- add_column(:users, :twitter, :character, {:null=>false, :default=>""})
main:    -> 0.0022s
main: -- add_column(:users, :linkedin, :character, {:null=>false, :default=>""})
main:    -> 0.0021s
main: == 20230116160904 RemoveUserDetailsFieldsFromUser: reverted (0.0231s) =========

How to set up and validate locally

  1. Apply the migration: scripts/db_tasks db:migrate.
  2. Run psql via GDK.
  3. Describe the users table -- \d users -- and check that the fields above are no longer present.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #206913 (closed)

Merge request reports

Loading