class ReplayEnhancements < ActiveRecord::Migration[7.2]
  def change
    change_table :recordings, bulk: true do |t|
      t.jsonb :metadata, null: false, default: {}
      t.string :thumbnail_storage_key
      t.integer :view_count, null: false, default: 0
      t.datetime :ready_notified_at
      t.datetime :expiry_warning_sent_at
      t.string :youtube_video_id
      t.datetime :youtube_published_at
    end

    add_index :recordings, :view_count
    add_index :recordings, :youtube_video_id, where: "youtube_video_id IS NOT NULL"
  end
end
