たとえば、usersテーブルのhoge_id
というカラムにコメントをつけたいとき。
bin/rails g migration AddCommentsToUsers
class AddCommentsToUsers < ActiveRecord::Migration[6.1] def change change_column_comment :users, :hoge_id, 'some comment here' end end
こんな感じでできる。
たとえば、usersテーブルのhoge_id
というカラムにコメントをつけたいとき。
bin/rails g migration AddCommentsToUsers
class AddCommentsToUsers < ActiveRecord::Migration[6.1] def change change_column_comment :users, :hoge_id, 'some comment here' end end
こんな感じでできる。