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: 20161018162500_create_intervention_participations_tables.rb
    path of file: ./repos/ekylibre/db/migrate
    
    the code of the file until where you have to start completion: class CreateInterventionParticipationsTables < ActiveRecord::Migration[4.2]
  def change
    create_table :intervention_participations do |t|
      t.references :intervention, index: true, foreign_key: true
      t.references :product, index: true, foreign_key: true

      t.string :state

    
    
  def change
    create_table :intervention_participations do |t|
      t.references :intervention, index: true, foreign_key: true
      t.references :product, index: true, foreign_key: true

      t.string :state

      t.boolean :request_compliant, null: false, default: false

      t.stamps
    end

    add_column :interventions, :request_compliant, :boolean

    add_reference :intervention_working_periods, :intervention_participation, foreign_key: true
    add_column    :intervention_working_periods, :nature, :string

    reversible do |dir|
      dir.up do
        change_column_null :intervention_working_periods, :intervention_id, true
      end

      dir.down do
        execute <<-SQL
          UPDATE intervention_working_periods AS working_periods
          SET    intervention_id = participations.intervention_id
            FROM  intervention_participations AS participations
            WHERE working_periods.intervention_participation_id = participations.id
              AND working_periods.intervention_id IS NULL;
          SQL
        change_column_null :intervention_working_periods, :intervention_id, false
      end
    end
  end