What\'s the syntax for dropping a database table column through a Rails migration?
remove_column
in change
method will help you to delete the column from the table.
class RemoveColumn < ActiveRecord::Migration
def change
remove_column :table_name, :column_name, :data_type
end
end
Go on this link for complete reference : http://guides.rubyonrails.org/active_record_migrations.html
Heres one more from rails console
ActiveRecord::Migration.remove_column(:table_name, :column_name)