parsley/db/migrate/20180912172758_add_is_ingredient_to_recipe.rb
Dan Elbert ffed63e0b3
Some checks failed
parsley/pipeline/head There was a failure building this commit
fixed
2018-09-12 14:17:18 -05:00

15 lines
329 B
Ruby

class AddIsIngredientToRecipe < ActiveRecord::Migration[5.2]
class RecipeMigrator < ActiveRecord::Base
self.table_name = 'recipes'
end
def change
add_column :recipes, :is_ingredient, :boolean, index: true
RecipeMigrator.reset_column_information
RecipeMigrator.update_all(is_ingredient: false)
end
end