#1 Schema adjusted

Signed-off-by: Benny Samir Hierl <bennysamir@posteo.de>
This commit is contained in:
Benny Samir Hierl 2022-02-05 14:45:56 +01:00
parent 82ac242d96
commit 56db8ba65a
2 changed files with 10 additions and 10 deletions

View file

@ -4,17 +4,17 @@ CREATE TABLE "Wishlist" (
"title" TEXT NOT NULL,
"imageSrc" TEXT NOT NULL,
"slugUrlText" TEXT NOT NULL,
"description" TEXT
"description" TEXT NOT NULL DEFAULT ''
);
-- CreateTable
CREATE TABLE "Item" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"title" TEXT NOT NULL,
"url" TEXT,
"imageSrc" TEXT,
"url" TEXT NOT NULL DEFAULT '',
"imageSrc" TEXT NOT NULL DEFAULT '',
"description" TEXT NOT NULL,
"comment" TEXT,
"comment" TEXT NOT NULL DEFAULT '',
"bought" BOOLEAN NOT NULL DEFAULT false,
"wishlistId" TEXT NOT NULL,
CONSTRAINT "Item_wishlistId_fkey" FOREIGN KEY ("wishlistId") REFERENCES "Wishlist" ("id") ON DELETE RESTRICT ON UPDATE CASCADE

View file

@ -15,17 +15,17 @@ model Wishlist {
title String
imageSrc String
slugUrlText String @unique
description String?
description String @default("")
items Item[]
}
model Item {
id Int @id @default(autoincrement())
title String
url String?
imageSrc String?
url String @default("")
imageSrc String @default("")
description String
comment String?
comment String @default("")
bought Boolean @default(false)
wishlist Wishlist @relation(fields: [wishlistId], references: [id])
wishlistId String