mirror of
https://github.com/veganhacktivists/arabot.git
synced 2025-11-29 17:28:02 +01:00
feat(arabot): add xp system
This commit is contained in:
13
prisma/migrations/20230304234222_xp/migration.sql
Normal file
13
prisma/migrations/20230304234222_xp/migration.sql
Normal file
@@ -0,0 +1,13 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "Xp" (
|
||||
"userId" TEXT NOT NULL,
|
||||
"level" INTEGER NOT NULL DEFAULT 0,
|
||||
"xp" INTEGER NOT NULL DEFAULT 0,
|
||||
"messageCount" INTEGER NOT NULL DEFAULT 0,
|
||||
"lastMessage" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
|
||||
CONSTRAINT "Xp_pkey" PRIMARY KEY ("userId")
|
||||
);
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "Xp" ADD CONSTRAINT "Xp_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
@@ -37,6 +37,7 @@ model User {
|
||||
muted Boolean @default(false)
|
||||
VerifyUser Verify[] @relation("verUser")
|
||||
VerifyVerifier Verify[] @relation("verVerifier")
|
||||
Xp Xp?
|
||||
Balance Balance?
|
||||
Daily Daily[]
|
||||
SendPayment Payment[] @relation("sendPayment")
|
||||
@@ -94,6 +95,15 @@ model Verify {
|
||||
notes String?
|
||||
}
|
||||
|
||||
model Xp {
|
||||
user User @relation(fields: [userId], references: [id])
|
||||
userId String @id
|
||||
level Int @default(0)
|
||||
xp Int @default(0)
|
||||
messageCount Int @default(0)
|
||||
lastMessage DateTime @default(now())
|
||||
}
|
||||
|
||||
// Economy
|
||||
|
||||
model Balance {
|
||||
|
||||
Reference in New Issue
Block a user