scinote-web/db/migrate/20160125205500_add_empty_field_to_asset.rb
2017-06-30 10:23:28 +02:00

11 lines
294 B
Ruby

class AddEmptyFieldToAsset < ActiveRecord::Migration[4.2]
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