mirror of
https://github.com/sern-handler/frontpage-bot
synced 2026-06-06 01:16:54 +00:00
feat: initial discord bot additions done
This commit is contained in:
15
prisma/migrations/20240517181500_add_bot/migration.sql
Normal file
15
prisma/migrations/20240517181500_add_bot/migration.sql
Normal 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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -0,0 +1,2 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "Bot" ALTER COLUMN "verified" SET DEFAULT false;
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user