Skip to content

Commit

Permalink
refactor: rewrite problem page (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
exKAZUu authored Sep 25, 2024
1 parent 8288f3a commit cd6456e
Show file tree
Hide file tree
Showing 7 changed files with 346 additions and 385 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
-- DropTable
PRAGMA foreign_keys=off;
DROP TABLE "ProblemSession";
PRAGMA foreign_keys=on;

-- CreateTable
CREATE TABLE "ProblemSession" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" DATETIME NOT NULL,
"userId" TEXT NOT NULL,
"courseId" TEXT NOT NULL,
"lectureId" TEXT NOT NULL,
"problemId" TEXT NOT NULL,
"problemVariablesSeed" TEXT NOT NULL,
"problemType" TEXT NOT NULL,
"traceItemIndex" INTEGER NOT NULL,
"elapsedMilliseconds" INTEGER NOT NULL DEFAULT 0,
"completedAt" DATETIME,
CONSTRAINT "ProblemSession_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
);
CREATE INDEX "ProblemSession_userId_courseId_lectureId_problemId_completedAt_idx" ON "ProblemSession"("userId", "courseId", "lectureId", "problemId", "completedAt");
7 changes: 3 additions & 4 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ model ProblemSession {
lectureId String
problemId String
problemVariablesSeed String
currentProblemType String
currentTraceItemIndex Int
previousTraceItemIndex Int
problemVariablesSeed String
problemType String
traceItemIndex Int
elapsedMilliseconds Int @default(0)
completedAt DateTime?
Expand Down

This file was deleted.

Loading

0 comments on commit cd6456e

Please sign in to comment.