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: 20161227125455_remove_workflow_state_from_course_users.rb
    path of file: ./repos/coursemology2/db/migrate
    
    the code of the file until where you have to start completion: class RemoveWorkflowStateFromCourseUsers < A
    
  def up
    ActsAsTenant.without_tenant do
      CourseUser.where(workflow_state: ['invited', 'rejected']).destroy_all
      CourseUser.where(workflow_state: 'requested').includes(:user, :course).each do |course_user|
        Course::EnrolRequest.transaction do
          Course::EnrolRequest.create!(course: course_user.course,
                                       user: course_user.user,
                                       created_at: course_user.created_at)
          course_user.destroy!
        end
      end
    end

    remove_column :course_users, :workflow_state
    change_column :course_users, :user_id, :integer, null: false
  end