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: 20220706112554_create_product_name_and_description_translations_for_mobility_table_backend.rb
    path of file: ./repos/spree/core/db/migrate
    
    the code of the file until where you have to start completion: class CreateProductNameAndDescriptionTranslationsForMobilityTableBackend < ActiveRecord::Migration[6.1]
  def change
    # create translation table only if spree_globalize has
    
  def change
    # create translation table only if spree_globalize has not already created it
    if ActiveRecord::Base.connection.table_exists? 'spree_product_translations'
      # manually check for index since Rails if_exists does not always work correctly
      if ActiveRecord::Migration.connection.index_exists?(:spree_product_translations, :spree_product_id)
        remove_index :spree_product_translations, name: "index_spree_product_translations_on_spree_product_id", if_exists: true
      end
    else
      create_table :spree_product_translations do |t|

        # Translated attribute(s)
        t.string :name
        t.text :description

        t.string  :locale, null: false
        t.references :spree_product, null: false, foreign_key: true, index: false

        t.timestamps null: false
      end

      add_index :spree_product_translations, :locale, name: :index_spree_product_translations_on_locale
    end