rails g migration addColumnToBlackIps send_time:datetime
db/migrate/20210529131328_add_column_to_black_ips.rb
class AddColumnToBlackIps < ActiveRecord::Migration[5.0] def change add_column :black_ips, :send_time, :datetime end end
rake db:migrate
CREATE TABLE `black_ips` ( `id` int(11) NOT NULL AUTO_INCREMENT, `ip` varchar(255) DEFAULT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, `send_time` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `index_black_ips_on_ip` (`ip`) ) ENGINE=InnoDB AUTO_INCREMENT=6115 DEFAULT CHARSET=utf8;