The source project of this merge request has been removed.
Drop user details fields from users table
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
- Apply the migration:
scripts/db_tasks db:migrate
. - Run
psql
via GDK. - 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.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #206913 (closed)