Server Module + DB (very early)
This commit is contained in:
1 parent
1b218fa7c3
commit
85976917b7
39 files changed
+2198
-708
No files matched your search
@@ -0,0 +1,22 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "Guild" (
|
||||
"id" TEXT NOT NULL,
|
||||
|
||||
CONSTRAINT "Guild_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "Event" (
|
||||
"objectId" SERIAL NOT NULL,
|
||||
"title" TEXT NOT NULL,
|
||||
"Roles" TEXT[],
|
||||
"guildId" TEXT NOT NULL,
|
||||
|
||||
CONSTRAINT "Event_pkey" PRIMARY KEY ("objectId")
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "Event_guildId_title_key" ON "Event"("guildId", "title");
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "Event" ADD CONSTRAINT "Event_guildId_fkey" FOREIGN KEY ("guildId") REFERENCES "Guild"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
@@ -0,0 +1,3 @@
|
||||
# Please do not edit this file manually
|
||||
# It should be added in your version-control system (i.e. Git)
|
||||
provider = "postgresql"
|
||||
@@ -0,0 +1,25 @@
|
||||
// This is your Prisma schema file,
|
||||
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
||||
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
}
|
||||
|
||||
datasource db {
|
||||
provider = "postgresql"
|
||||
url = env("DATABASE_URL")
|
||||
}
|
||||
|
||||
model Guild {
|
||||
id String @id
|
||||
events Event[]
|
||||
}
|
||||
|
||||
model Event {
|
||||
objectId Int @id @default(autoincrement())
|
||||
title String
|
||||
Roles String[]
|
||||
Guild Guild? @relation(fields: [guildId], references: [id])
|
||||
guildId String
|
||||
@@unique([guildId, title], name: "eventIdentifier")
|
||||
}
|
||||
Reference in new issue
Block a user