mirror of
https://github.com/ThisIsBenny/wishlist-app.git
synced 2025-04-19 23:37:41 +00:00
#1 Schema adjusted
Signed-off-by: Benny Samir Hierl <bennysamir@posteo.de>
This commit is contained in:
parent
82ac242d96
commit
56db8ba65a
2 changed files with 10 additions and 10 deletions
|
@ -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
|
|
@ -15,18 +15,18 @@ model Wishlist {
|
|||
title String
|
||||
imageSrc String
|
||||
slugUrlText String @unique
|
||||
description String?
|
||||
description String @default("")
|
||||
items Item[]
|
||||
}
|
||||
|
||||
model Item {
|
||||
id Int @id @default(autoincrement())
|
||||
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])
|
||||
wishlist Wishlist @relation(fields: [wishlistId], references: [id])
|
||||
wishlistId String
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue