You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: 064_update_teams_for_course.rb
    path of file: ./repos/expertiza/db/migrate
    
    the code of the file until where you have to start completion: class UpdateTeamsForCourse < ActiveRecord::Migration[4.2]
  def self.up
    begin
      execute 'ALTER TABLE `teams` 
    
  def self.down
    teams = Team.all
    teams.each do |team|
      team.delete if team.type == 'CourseTeam'
    end

    remove_column :teams, :type
    rename_column :teams, :parent_id, :assignment_id
  end