Skip to content

Commit

Permalink
chore: update database migration
Browse files Browse the repository at this point in the history
  • Loading branch information
sjschlapbach committed Aug 26, 2024
1 parent 61361fd commit e63c8ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
- You are about to drop the column `meanFirstCorrectCount` on the `ParticipantAnalytics` table. All the data in the column will be lost.
- You are about to drop the column `meanLastCorrectCount` on the `ParticipantAnalytics` table. All the data in the column will be lost.
- You are about to drop the column `collectedAchievements` on the `ParticipantAnalytics` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE "ParticipantAnalytics" DROP COLUMN "meanFirstCorrectCount",
DROP COLUMN "meanLastCorrectCount",
DROP COLUMN "collectedAchievements",
ADD COLUMN "firstCorrectCount" REAL,
ADD COLUMN "firstWrongCount" REAL,
ADD COLUMN "lastCorrectCount" REAL,
Expand Down
5 changes: 1 addition & 4 deletions packages/prisma/src/prisma/schema/analytics.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ model ParticipantAnalytics {
totalPoints Int
totalXp Int
// meanTrialsCount = meanCorrectCount + meanPartialCorrectCount + meanWrongCount
// responseCount = meanCorrectCount + meanPartialCorrectCount + meanWrongCount
meanCorrectCount Float @db.Real // mean over responses to same question and sum over all questions
meanPartialCorrectCount Float @db.Real // mean over responses to same question and sum over all questions
meanWrongCount Float @db.Real // mean over responses to same question and sum over all questions
Expand All @@ -39,9 +39,6 @@ model ParticipantAnalytics {
firstWrongCount Float? @db.Real // aggregated over all questions (sum)
lastWrongCount Float? @db.Real // aggregated over all questions (sum)
// add id of achievement
collectedAchievements String[]
competencyAnalytics CompetencyAnalytics[]
participant Participant @relation(fields: [participantId], references: [id], onDelete: Cascade, onUpdate: Cascade)
Expand Down

0 comments on commit e63c8ad

Please sign in to comment.