class UpdateTaskItems < ActiveRecord::Migration[5.2]

  class TaskItemMigrator < ActiveRecord::Base
    self.table_name = 'task_items'
  end

  def change
    add_column :task_items, :completed, :boolean

    TaskItemMigrator.reset_column_information
    TaskItemMigrator.update_all(completed: false)
  end
end
