Rails table column add

Add Column to db:migrated Table in Rails

This is a memo about how to add a column to a table that has already been db:migrated in Rails. Use the rails generate migration command as follows. For example, `rails generate migration add_count_to_counts count:integer`.

Shou Arisaka
1 min read
Nov 6, 2025

This is a memo about how to add a column to a table that has already been db:migrated in Rails. Use the rails generate migration command as follows. For example, rails generate migration add_count_to_counts count:integer.

# rails generate migration add_[column_name]_to_[table_name] [column_name]:[type]
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

Share this article

Shou Arisaka Nov 6, 2025

๐Ÿ”— Copy Links