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