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