Files
ranked-eqao/prisma/migrations/20260507153955_grade_enum/migration.sql
T

26 lines
1.1 KiB
SQL

/*
Warnings:
- Changed the type of `grade` on the `GameSession` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required.
- Changed the type of `grade` on the `LeaderboardEntry` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required.
- Changed the type of `grade` on the `Question` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required.
*/
-- CreateEnum
CREATE TYPE "Grade" AS ENUM ('G3', 'G6', 'G9');
-- AlterTable
ALTER TABLE "GameSession" DROP COLUMN "grade",
ADD COLUMN "grade" "Grade" NOT NULL;
-- AlterTable
ALTER TABLE "LeaderboardEntry" DROP COLUMN "grade",
ADD COLUMN "grade" "Grade" NOT NULL;
-- AlterTable
ALTER TABLE "Question" DROP COLUMN "grade",
ADD COLUMN "grade" "Grade" NOT NULL;
-- CreateIndex
CREATE UNIQUE INDEX "LeaderboardEntry_userId_grade_subject_key" ON "LeaderboardEntry"("userId", "grade", "subject");