dav*_*ghz 66
要通过迁移删除列:
rails g migration Remove..From.. col1:type col2:type col3:type
在你的情况下:
rails g migration RemoveCountryFromSampleApps country:string
这将在Rails 5.0中生成以下迁移:
class RemoveCountryFromSampleApps < ActiveRecord::Migration[5.0]
  def change
    remove_column :sample_apps, :country, :string
  end
end
| 归档时间: | 
 | 
| 查看次数: | 28304 次 | 
| 最近记录: |