class AddCommmentsToStaffEmail < ActiveRecord::Migration[6.0]
def change
change_column_comment(:staff_emails, :employee_id, 'Trader ID')
end
end
change_column_comment Enter the table name, column name, and comment content in change_column_comment.
change_column_comment(:table_name, :column_name, 'contents')
Creation of migration file
command
cmd.
$bundel exec rails g migration AddCommentsToTable
Perform migration
command
cmd.
$bundel exec rake db:migrate
--Reference link
http://hotoolong.hatenablog.com/entry/2018/06/20/083106
Recommended Posts