-- Migration: Rename participant_expected_values.season_id to sports_season_id
-- and update foreign key to reference sports_seasons instead of seasons

-- Drop the old foreign key constraint
ALTER TABLE "participant_expected_values" DROP CONSTRAINT "participant_expected_values_season_id_seasons_id_fk";

-- Rename the column
ALTER TABLE "participant_expected_values" RENAME COLUMN "season_id" TO "sports_season_id";

-- Add the new foreign key constraint referencing sports_seasons
ALTER TABLE "participant_expected_values" ADD CONSTRAINT "participant_expected_values_sports_season_id_sports_seasons_id_fk" FOREIGN KEY ("sports_season_id") REFERENCES "sports_seasons"("id") ON DELETE cascade ON UPDATE no action;
