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: 20240302135931_add_make_active_at_to_spree_products.spree.rb
    path of file: ./repos/spree_starter/db/migrate
    
    the code of the file until where you have to start completion: # This migration comes from spree (originally 20220117100333)
class AddMakeActiveAtToSpreeProducts < ActiveRecord::Migration[5.2]
  def change
    add_column :spree_products, :make_active_at, :datetime
    add_index :spree_products, :make_active_at

    Spree::Product.
      where('discontinu
    
  def change
    add_column :spree_products, :make_active_at, :datetime
    add_index :spree_products, :make_active_at

    Spree::Product.
      where('discontinue_on IS NULL or discontinue_on > ?', Time.current).
      where('available_on <= ?', Time.current).
      where(status: 'draft').
      update_all(status: 'active', updated_at: Time.current)

    Spree::Product.
      where('discontinue_on <= ?', Time.current).
      where.not(status: 'archived').
      update_all(status: 'archived', updated_at: Time.current)
  end