/*
  Warnings:

  - You are about to drop the column `loserId` on the `Points` table. All the data in the column will be lost.
  - You are about to drop the column `winnerId` on the `Points` table. All the data in the column will be lost.

*/
-- DropForeignKey
ALTER TABLE "Points" DROP CONSTRAINT "Points_loserId_fkey";

-- DropForeignKey
ALTER TABLE "Points" DROP CONSTRAINT "Points_winnerId_fkey";

-- AlterTable
ALTER TABLE "Matches" ADD COLUMN     "home_score" INTEGER DEFAULT 0,
ADD COLUMN     "visitor_score" INTEGER DEFAULT 0;

-- AlterTable
ALTER TABLE "Points" DROP COLUMN "loserId",
DROP COLUMN "winnerId",
ADD COLUMN     "loser_id" INTEGER,
ADD COLUMN     "winner_id" INTEGER;

-- AddForeignKey
ALTER TABLE "Points" ADD CONSTRAINT "Points_winner_id_fkey" FOREIGN KEY ("winner_id") REFERENCES "teams"("team_id") ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "Points" ADD CONSTRAINT "Points_loser_id_fkey" FOREIGN KEY ("loser_id") REFERENCES "teams"("team_id") ON DELETE SET NULL ON UPDATE CASCADE;
