edited the user, added the event and editet the Post to Auftrag
This commit is contained in:
parent
edcba539de
commit
4d97c9d08d
BIN
prisma/dev.db
BIN
prisma/dev.db
Binary file not shown.
Binary file not shown.
33
prisma/migrations/20230929083231_init/migration.sql
Normal file
33
prisma/migrations/20230929083231_init/migration.sql
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the `Post` table. If the table is not empty, all the data it contains will be lost.
|
||||
|
||||
*/
|
||||
-- DropTable
|
||||
PRAGMA foreign_keys=off;
|
||||
DROP TABLE "Post";
|
||||
PRAGMA foreign_keys=on;
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "Event" (
|
||||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
"date" TEXT NOT NULL,
|
||||
"time" TEXT NOT NULL,
|
||||
"location" TEXT NOT NULL
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "Auftrag" (
|
||||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
"title" TEXT NOT NULL,
|
||||
"ticket" TEXT,
|
||||
"eventID" INTEGER NOT NULL,
|
||||
"published" BOOLEAN NOT NULL DEFAULT false,
|
||||
"authorId" INTEGER NOT NULL,
|
||||
CONSTRAINT "Auftrag_eventID_fkey" FOREIGN KEY ("eventID") REFERENCES "Event" ("id") ON DELETE RESTRICT ON UPDATE CASCADE,
|
||||
CONSTRAINT "Auftrag_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "Auftrag_eventID_key" ON "Auftrag"("eventID");
|
@ -14,13 +14,23 @@ model User {
|
||||
id Int @id @default(autoincrement())
|
||||
email String @unique
|
||||
name String?
|
||||
posts Post[]
|
||||
posts Auftrag[]
|
||||
}
|
||||
|
||||
model Post {
|
||||
model Event {
|
||||
id Int @id @default(autoincrement())
|
||||
date String
|
||||
time String
|
||||
location String
|
||||
Auftrag Auftrag?
|
||||
}
|
||||
|
||||
model Auftrag {
|
||||
id Int @id @default(autoincrement())
|
||||
title String
|
||||
content String?
|
||||
ticket String?
|
||||
event Event @relation(fields: [eventID],references: [id])
|
||||
eventID Int @unique
|
||||
published Boolean @default(false)
|
||||
author User @relation(fields: [authorId], references: [id])
|
||||
authorId Int
|
||||
|
Loading…
Reference in New Issue
Block a user