/*
  Warnings:

  - A unique constraint covering the columns `[home_team]` on the table `Matches` will be added. If there are existing duplicate values, this will fail.
  - Changed the type of `home_team` on the `Matches` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required.

*/
-- AlterTable
ALTER TABLE "Matches" DROP COLUMN "home_team",
ADD COLUMN     "home_team" INTEGER NOT NULL;

-- CreateIndex
CREATE UNIQUE INDEX "Matches_home_team_key" ON "Matches"("home_team");

-- AddForeignKey
ALTER TABLE "Matches" ADD CONSTRAINT "Matches_home_team_fkey" FOREIGN KEY ("home_team") REFERENCES "teams"("team_id") ON DELETE RESTRICT ON UPDATE CASCADE;
