db updates

This commit is contained in:
2026-07-11 12:31:22 -04:00
parent a8c41a6852
commit fa2a1e7639
6 changed files with 906 additions and 1 deletions
@@ -0,0 +1,16 @@
-- CreateTable
CREATE TABLE "MatchResult" (
"id" TEXT NOT NULL,
"userId" TEXT NOT NULL,
"grade" "Grade" NOT NULL,
"won" BOOLEAN NOT NULL,
"eloChange" INTEGER NOT NULL,
"eloAfter" INTEGER NOT NULL,
"timeSpentMs" INTEGER,
"playedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "MatchResult_pkey" PRIMARY KEY ("id")
);
-- AddForeignKey
ALTER TABLE "MatchResult" ADD CONSTRAINT "MatchResult_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;