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: 20210517195714_update_materialized_view_mvw_infrequency_tracking_classrooms.rb
    path of file: ./repos/i-diario/db/migrate
    
    the code of the file until where you have to start completion: class UpdateMaterializedViewMvwInfrequencyTrackingClassrooms < ActiveRecord::Migration[4.2]
  def change
    execute <<-SQL
      DROP MATERIALIZED VIEW mvw_infrequency_tracking_classrooms;

      CREATE MATERIALIZED VIEW mvw_infrequency_tracking_classrooms AS
      SELECT classrooms.id AS id,
             classrooms.description AS description,
             classrooms.year AS year,
             classrooms_grades.grade_id A
    
  def change
    execute <<-SQL
      DROP MATERIALIZED VIEW mvw_infrequency_tracking_classrooms;

      CREATE MATERIALIZED VIEW mvw_infrequency_tracking_classrooms AS
      SELECT classrooms.id AS id,
             classrooms.description AS description,
             classrooms.year AS year,
             classrooms_grades.grade_id AS grade_id,
             classrooms.unity_id AS unity_id
        FROM infrequency_trackings
        JOIN classrooms
          ON classrooms.id = infrequency_trackings.classroom_id
        JOIN classrooms_grades
          ON classrooms_grades.classroom_id = classrooms.id
    GROUP BY classrooms.id, classrooms.description, classrooms.year, classrooms_grades.grade_id, classrooms.unity_id;
    SQL
  end