title: Best way to add_index to database
body: <p>I have the following two migrations already in my database:</p>
  
  <p><strong>When I created Prices:</strong></p>
  
  <pre><code>class CreatePrices &lt; ActiveRecord::Migration
    def self.up
      create_table :prices do |t|
        t.string :price_name
        t.decimal :price
        t.date :date
  
        t.timestamps
      end
      # add_index :prices (not added)
    end
  
    def self.down
      drop_table :prices
    end
  end
  </code></pre>
  
  <p><strong>and when I added a user_id to Prices:</strong></p>
  
  <pre><code>class AddUserIdToPrices &lt; ActiveRecord::Migration
    def self.up
      add_column :prices, :user_id, :integer
    end
    # add_index :user_id (not added)
  end
  
    def self.down
      remove_column :prices, :user_id
    end
  end
  </code></pre>
  
  <p>Is there a way from the command line to add prices and user_id to index? I looked at <a href="https://stackoverflow.com/questions/6108340/rails-how-to-add-add-index-to-existing-table" title="this question">this question</a> and still was confused on how to go about adding indexes and the parts where I put "not added" seem like they would be error-prone because they were earlier migrations.</p>
  
  <p>My question is, what is the best way for me to add indexing to prices and user_id?</p>
  
  <p>Thank you for the help!</p>