Railsでdb:migrate済みのテーブルにカラムを追加する方法についてメモです。
rails generate migrationコマンドを以下のように使用します。
例えば、`rails generate migration add_count_to_counts count:integer`といったものです。
# rails generate migration add_[カラム名]_to_[テーブル名] [カラム名]:[型]
rails generate migration add_count_to_counts count:integer
rails db:migrate
Adding a column to an existing table in a Rails migration – Stack Overflow