db/migrate/20220408210829_create_microposts.rb (10 lines of code) (raw):
class CreateMicroposts < ActiveRecord::Migration[7.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