feat: add Prisma schema for pairing history

Add MongoDB schema with Prisma 6.8.2 for tracking:
- ServerEvent: events per server (coffee chats, study groups, etc.)
- UserPairingHistory: user pairing records per server
- PairingRecord: individual pairing entries with event context

This enables smart grouping that avoids recent pairings per-event.
This commit is contained in:
2026-01-21 17:56:28 -08:00
committed by Naomi Carrigan
parent 5003386577
commit ce59bf47f9
2 changed files with 48 additions and 0 deletions
+13
View File
@@ -1,5 +1,12 @@
{
"name": "rondelle",
"pnpm": {
"onlyBuiltDependencies": [
"@prisma/engines",
"esbuild",
"prisma"
]
},
"version": "0.0.0",
"description": "",
"main": "./prod/index.js",
@@ -17,6 +24,12 @@
"@nhcarrigan/eslint-config": "5.2.0",
"@nhcarrigan/typescript-config": "1.0.0",
"@types/node": "22.10.6",
"prisma": "6.8.2",
"typescript": "5.7.3"
},
"dependencies": {
"@nhcarrigan/logger": "1.1.1",
"@prisma/client": "6.8.2",
"discord.js": "14.25.1"
}
}
+35
View File
@@ -0,0 +1,35 @@
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "mongodb"
url = env("MONGO_URI")
}
model ServerEvent {
id String @id @default(auto()) @map("_id") @db.ObjectId
serverId String
eventId String
eventName String
createdAt DateTime @default(now())
createdBy String
@@unique([serverId, eventId])
@@index([serverId])
}
model UserPairingHistory {
id String @id @default(auto()) @map("_id") @db.ObjectId
userId String
serverId String
pairings PairingRecord[]
@@unique([userId, serverId])
}
type PairingRecord {
recipientId String
eventId String
sessionDate DateTime
}