class CreateUserPostViews < ActiveRecord::Migration[7.0]
  def change
    create_table :user_post_views do |t|
      t.references :user, null: false, foreign_key: { to_table: :users }
      t.references :post, null: false, foreign_key: { to_table: :posts }
      t.boolean :viewed, default: false, null: false
      t.timestamps
    end
  end
end
