feat: initial discord bot additions done

This commit is contained in:
2024-05-18 00:31:09 +02:00
parent 5060adb9d3
commit 6767bb36b0
24 changed files with 340 additions and 32 deletions

View File

@@ -0,0 +1,15 @@
-- CreateTable
CREATE TABLE "Bot" (
"id" TEXT NOT NULL,
"userId" TEXT NOT NULL,
"name" TEXT NOT NULL,
"verified" BOOLEAN NOT NULL,
"inviteLink" TEXT NOT NULL,
"pfpLink" TEXT NOT NULL,
"srcLink" TEXT,
CONSTRAINT "Bot_pkey" PRIMARY KEY ("id")
);
-- AddForeignKey
ALTER TABLE "Bot" ADD CONSTRAINT "Bot_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;

View File

@@ -0,0 +1,8 @@
/*
Warnings:
- Added the required column `botId` to the `Bot` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE "Bot" ADD COLUMN "botId" TEXT NOT NULL;

View File

@@ -0,0 +1,8 @@
/*
Warnings:
- Added the required column `description` to the `Bot` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE "Bot" ADD COLUMN "description" TEXT NOT NULL;

View File

@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "Bot" ALTER COLUMN "verified" SET DEFAULT false;

View File

@@ -14,10 +14,11 @@ datasource db {
}
model User {
id String @id @default(cuid())
username String @unique
id String @id @default(cuid())
username String @unique
hashed_password String
sessions Session[]
sessions Session[]
bots Bot[]
}
model Session {
@@ -25,4 +26,18 @@ model Session {
userId String
expiresAt DateTime
user User @relation(references: [id], fields: [userId], onDelete: Cascade)
}
}
model Bot {
id String @id @default(cuid())
userId String
user User @relation(references: [id], fields: [userId], onDelete: Cascade)
name String
description String
verified Boolean @default(false)
inviteLink String
pfpLink String
srcLink String?
botId String
}