db/migrate/20190824113338_create_microposts.rb (10 lines of code) (raw):

class CreateMicroposts < ActiveRecord::Migration[6.0] def change create_table :microposts do |t| t.text :content t.references :user, null: false, foreign_key: true t.timestamps end add_index :microposts, [:user_id, :created_at] end end