mirror of
https://github.com/veganhacktivists/arabot.git
synced 2025-05-18 13:44:13 +02:00
feat(db): add counting table
This commit is contained in:
parent
871696bf89
commit
d27871e0f7
11
prisma/migrations/20231111144714_counting/migration.sql
Normal file
11
prisma/migrations/20231111144714_counting/migration.sql
Normal file
@ -0,0 +1,11 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "Counting" (
|
||||
"id" SERIAL NOT NULL,
|
||||
"userId" TEXT NOT NULL,
|
||||
"number" INTEGER NOT NULL,
|
||||
|
||||
CONSTRAINT "Counting_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "Counting" ADD CONSTRAINT "Counting_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
@ -47,6 +47,7 @@ model User {
|
||||
ModRoleLog RoleLog[] @relation("modRoleLog")
|
||||
FunLogSender FunLog[] @relation("sendFunLog")
|
||||
FunLogReciever FunLog[] @relation("receiveFunLog")
|
||||
Counting Counting[] @relation("counting")
|
||||
EventLeader Event[] @relation("eventLeader")
|
||||
StatLeader Stat[] @relation("statLeader")
|
||||
OutreachParticipation ParticipantStat[] @relation("participantUser")
|
||||
@ -179,6 +180,13 @@ model FunType {
|
||||
FunLog FunLog[]
|
||||
}
|
||||
|
||||
model Counting {
|
||||
id Int @id @default(autoincrement())
|
||||
user User @relation("counting", fields: [userId], references: [id])
|
||||
userId String
|
||||
number Int // This is the number that the user has counted, if the count failed, the number should be 0
|
||||
}
|
||||
|
||||
// Outreach
|
||||
|
||||
model Event {
|
||||
|
Loading…
x
Reference in New Issue
Block a user