class AddTeamProfileAndRoster < ActiveRecord::Migration[7.2]
  def change
    add_column :teams, :description, :text

    create_table :team_roster_members, id: :uuid do |t|
      t.references :team, null: false, foreign_key: true, type: :uuid
      t.string :category, null: false, default: "player"
      t.string :full_name, null: false
      t.string :role_label
      t.integer :jersey_number
      t.text :bio
      t.integer :position, null: false, default: 0

      t.timestamps
    end

    add_index :team_roster_members, %i[team_id category position]
  end
end
