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: 20200213155459_add_unique_index_to_users.rb
    path of file: ./repos/homeland/db/migrate
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

class AddUniqueIndexToUsers < ActiveRecord::Migration[6.0]
  def up
    execute <<~SQL
     
    
  def up
    execute <<~SQL
      DELETE FROM users u WHERE u.id NOT IN (SELECT MIN(id) FROM users GROUP BY login)
    SQL
    execute <<~SQL
      DELETE FROM users u WHERE u.id NOT IN (SELECT MIN(id) FROM users GROUP BY email)
    SQL

    remove_index :users, :login
    remove_index :users, :email
    add_index :users, :login, unique: true
    add_index :users, :email, unique: true
  end