DB schema changed

Signed-off-by: Benny Samir Hierl <bennysamir@posteo.de>
This commit is contained in:
Benny Samir Hierl 2022-01-29 18:42:26 +01:00
parent 271e033a5a
commit 8272237d50
5 changed files with 11 additions and 11 deletions

View file

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

View file

@ -23,10 +23,10 @@ model Item {
id Int @id @default(autoincrement())
title String
url String?
image String?
imageSrc String?
description String
comment String?
bought Boolean @default(false)
wishlist Wishlist? @relation(fields: [wishlistId], references: [id])
wishlistId String?
wishlist Wishlist @relation(fields: [wishlistId], references: [id])
wishlistId String
}

View file

@ -51,7 +51,7 @@ export const getBySlugUrl = <RouteOptions>{
id: { type: 'number' },
title: { type: 'string' },
url: { type: 'string' },
image: { type: 'string' },
imageSrc: { type: 'string' },
description: { type: 'string' },
comment: { type: 'string' },
bought: { type: 'boolean' },

View file

@ -2,7 +2,7 @@ export interface WishlistItem {
id: string
title: string
url: string
image: string
imageSrc: string
description: string
comment: string
bought: boolean

View file

@ -46,7 +46,7 @@ const bought = async (item: WishlistItemType): Promise<void> => {
:key="index"
:title="item.title"
:url="item.url"
:image="item.image"
:image="item.imageSrc"
:description="item.description"
:comment="item.comment"
@bought="bought(item)"