class CreateMicroposts < ActiveRecord::Migration
  def change
    create_table :microposts do |t|
      t.string :content
      t.integer :user_id

      t.timestamps null: false
    end
  end
end

class CreateMicroposts < ActiveRecord::Migration
  def change
    create_table :microposts do |t|
      t.string :content
      t.integer :user_id

      t.timestamps null: false
    end
    add_index :microposts, [:user_id, :created_at]
  end
end

Create index for user_id, created_at in Micropost
Create index for user_id, created_at in Micropost
