scinote-web/db/migrate/20160125205500_add_empty_field_to_asset.rb

11 lines
288 B
Ruby
Raw Normal View History

2016-02-12 23:52:43 +08:00
class AddEmptyFieldToAsset < ActiveRecord::Migration
def up
add_column :assets, :file_present, :boolean, default: false
Asset.update_all(file_present: true)
change_column_null :assets, :file_present, false
end
def down
remove_column :assets, :file_present
end
end